Update Project Scripts

This commit is contained in:
Allan Niles 2025-07-06 17:41:13 -06:00
parent e150dc0491
commit 6161d7f140
No known key found for this signature in database
GPG Key ID: 4801D0A65C62A5B6
3 changed files with 29 additions and 1 deletions

View File

@ -13,3 +13,4 @@ data/cores/*
minify/
.npmignore
.gitignore
roms/

View File

@ -12,6 +12,30 @@ Donate to: [EmulatorJS](https://www.patreon.com/EmulatorJS)
Donate to: [libretro](https://retroarch.com/index.php?page=donate)
## Project Scripts
The project has several scripts that can be used to help with updating and deploying the project.
### Build Script
Runs the build script, which will compresses the project in 7z and zip output in dist/ folder. Note: Make sure you have the compiled cores in the `data/cores` folder before running this script.
```bash
npm run build
```
### Update Script
Runs the update script, which updates dependencies and can change version number of project. It also will update the list of contributors.
```bash
npm run update # Just updates contributors list
npm run update -- --ejs_v=4.3.1 # Updates contributors list and sets version to 4.3.1
npm run update -- --deps=true # Updates contributors list and updates dependencies
npm run update -- --dev=true # Updates contributors list and enables dev mode
npm run update -- --dev=false # Updates contributors list and disables dev mode
```
## Attention Visual Studio Code Users
By default Visual Studio Code will apply formatting that is not consistent with the standard formatting used by this project.

View File

@ -5,6 +5,7 @@ import fetch from 'node-fetch';
const args = process.argv.slice(2);
const versionArg = args.find(arg => arg.startsWith('--ejs_v='));
const devArg = args.find(arg => arg.startsWith('--dev='));
const depsArg = args.find(arg => arg.startsWith('--deps='));
const update_version = versionArg ? versionArg.split('=')[1] : process.env.ejs_v;
const dev = devArg ? devArg.split('=')[1] : null;
let version;
@ -117,7 +118,9 @@ if (!update_version) {
}
console.log("Updating EmulatorJS dependencies...");
await updateDependencies();
if (depsArg) {
await updateDependencies();
}
if (update_version || dev === "false" || dev === "true") {
console.log("Updating EmulatorJS version...");
await updateVersion(update_version || version);