diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-08-13 23:53:16 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-08-13 23:53:16 -0700 |
commit | 405bc8ad7b96aa1f91444909eca6eae5f3044a6d (patch) | |
tree | 34451edfcb79004e8405be46e4a14675f7412b69 /extension/scripts | |
parent | 3541d6a770c919e1f2e55a1ae53c4fc3abe31aa7 (diff) | |
download | sncontinue-405bc8ad7b96aa1f91444909eca6eae5f3044a6d.tar.gz sncontinue-405bc8ad7b96aa1f91444909eca6eae5f3044a6d.tar.bz2 sncontinue-405bc8ad7b96aa1f91444909eca6eae5f3044a6d.zip |
ci: :green_heart: split into package and prepackage steps
Diffstat (limited to 'extension/scripts')
-rw-r--r-- | extension/scripts/package.js | 43 | ||||
-rw-r--r-- | extension/scripts/prepackage.js | 31 |
2 files changed, 37 insertions, 37 deletions
diff --git a/extension/scripts/package.js b/extension/scripts/package.js index 59da9181..8f1e68fd 100644 --- a/extension/scripts/package.js +++ b/extension/scripts/package.js @@ -1,42 +1,11 @@ const { exec } = require("child_process"); const fs = require("fs"); -const path = require("path"); -exec("npm install", (error) => { - if (error) throw error; - console.log("npm install completed"); - - exec("npm run typegen", (error) => { - if (error) throw error; - console.log("npm run typegen completed"); - - process.chdir("react-app"); - - exec("npm install", (error) => { - if (error) throw error; - console.log("npm install in react-app completed"); +if (!fs.existsSync("build")) { + fs.mkdirSync("build"); +} - exec("npm run build", (error) => { - if (error) throw error; - if (!fs.existsSync(path.join("dist", "assets", "index.js"))) { - throw new Error("react-app build did not produce index.js"); - } - if (!fs.existsSync(path.join("dist", "assets", "index.css"))) { - throw new Error("react-app build did not produce index.css"); - } - console.log("npm run build in react-app completed"); - - process.chdir(".."); - - if (!fs.existsSync("build")) { - fs.mkdirSync("build"); - } - - exec("vsce package --out ./build patch", (error) => { - if (error) throw error; - console.log("vsce package completed"); - }); - }); - }); - }); +exec("vsce package --out ./build patch", (error) => { + if (error) throw error; + console.log("vsce package completed"); }); diff --git a/extension/scripts/prepackage.js b/extension/scripts/prepackage.js new file mode 100644 index 00000000..c55df802 --- /dev/null +++ b/extension/scripts/prepackage.js @@ -0,0 +1,31 @@ +const { exec } = require("child_process"); +const fs = require("fs"); +const path = require("path"); + +exec("npm install", (error) => { + if (error) throw error; + console.log("npm install completed"); + + exec("npm run typegen", (error) => { + if (error) throw error; + console.log("npm run typegen completed"); + + process.chdir("react-app"); + + exec("npm install", (error) => { + if (error) throw error; + console.log("npm install in react-app completed"); + + exec("npm run build", (error) => { + if (error) throw error; + if (!fs.existsSync(path.join("dist", "assets", "index.js"))) { + throw new Error("react-app build did not produce index.js"); + } + if (!fs.existsSync(path.join("dist", "assets", "index.css"))) { + throw new Error("react-app build did not produce index.css"); + } + console.log("npm run build in react-app completed"); + }); + }); + }); +}); |