| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Maybe if you add the sea-config.json to itself, you can then parse it as json, and get the list of assets. Meets the "define once " test, and relatively low overhead at runtime |
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
{{title}}
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
{{editor}}'s edit
{{editor}}'s edit
Uh oh!
There was an error while loading. Please reload this page.
I'm trying to write an SEA that will let my users easily deploy projects to a hosted server.
Right now almost everything is working great! I can run mySEAApp <path_to_some_foler_to_deploy> and it parses through all the files in the directory provided, updates the things it needs to update (ie injects some headers into specific files), and pushes it all to my remote server.
The next thing I need to do is add a few standard files to the folder before its deployed it to the remote server. I think the right way to do this is by adding those files as assets to my sea-config.json file. I'm assuming I could individually specify each of these and copy them over, but I'm wondering if there is any way to get a list of the assets I specified in the config from the SEA just so I don't have to manually code each of them.
Right now I'm assuming I have to do something kind of like this...
if (isSea()) { const file1 = getAsset("file1.js"); fs.writeFile(file1, assetsFolder); const file2 = getAsset("file2.js"); fs.writeFile(file2 assetsFolder); ... const fileN = getAsset("fileN.js"); fs.writeFile(fileN, assetsFolder); }I'm hoping I can do this, so I don't have to update the code any time I add a new asset to the config.
if (isSea()) { const assets = getListofSEAassets(); assets.forEach( asset => fs.writeFile(getAsset(asset), assetsFlder)); } Does something like this exist?