forked from abeisgoat/firepit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
281 additions
and
1,557 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/**/node_modules/** | ||
firepit-** | ||
dist/** | ||
.idea/** | ||
config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env bash | ||
const { mkdir, cat, cd, rm, find, echo, exec, mv } = require("shelljs"); | ||
const npm = (...args) => exec(["npm", ...args].join(" ")); | ||
|
||
cd("vendor"); | ||
|
||
echo("-- Cleaning vendors..."); | ||
rm("-f", "config.js"); | ||
rm("-rf", "node_modules"); | ||
|
||
echo("-- Installing new vendor/node_modules"); | ||
npm("install", "firebase-tools@latest"); | ||
|
||
echo("-- Removing native platform addons (.node)"); | ||
find(".") | ||
.filter(function(file) { | ||
return file.match(/\.node$/); | ||
}) | ||
.forEach(file => { | ||
echo(file); | ||
rm(file); | ||
}); | ||
cd(".."); | ||
|
||
echo("-- Cleaning builds..."); | ||
rm("-rf", "dist/*"); | ||
|
||
echo("-- Building headless binaries..."); | ||
|
||
const headless_config = cat("config.template.js").replace( | ||
"headless_value", | ||
"true" | ||
); | ||
echo(headless_config).to("config.js"); | ||
npm("run", "pkg"); | ||
mkdir("-p", "dist/headless"); | ||
mv("dist/firpeit-*", "dist/headless"); | ||
|
||
echo("-- Building headed binaries..."); | ||
|
||
const headful_config = cat("config.template.js").replace( | ||
"headless_value", | ||
"false" | ||
); | ||
echo(headful_config).to("config.js"); | ||
npm("run", "pkg"); | ||
mkdir("-p", "dist/headed"); | ||
mv("dist/firepit-*", "dist/headed"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = { | ||
/* | ||
Headless mode forces the firepit builds to exactly imitate firebase-tools, | ||
so the resulting binary "firebase" is a drop in replacement for the script | ||
installed via npm. This is the behavior for CI / Cloud Shell / Docker etc. | ||
When headless mode is disabled, the "double click" experience is enabled | ||
which allows the binary to spawn a terminal on Windows and Mac. The is the | ||
behavior for desktop users. | ||
*/ | ||
headless: headless_value | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.