[Scripts > InjectPoly] Rewrite as bash script

This commit is contained in:
Ducko 2022-01-19 18:42:42 +00:00
parent b9e8779b06
commit d48c91679a
3 changed files with 3 additions and 15 deletions

View file

@ -1,14 +0,0 @@
const { readdirSync, copyFileSync, mkdirSync } = require('fs');
const { join } = require('path');
const rootDir = join(__dirname, '..');
const nodeModules = join(rootDir, 'src', 'node_modules');
mkdirSync(nodeModules, { recursive: true }); // Ensure node_modules exists
const polyfillsDir = join(rootDir, 'polyfills');
for (const file of readdirSync(polyfillsDir)) {
const [ name ] = file.split('.');
const jsPath = join(polyfillsDir, file);
copyFileSync(jsPath, join(nodeModules, name + '.js'));
}

2
scripts/injectPolyfills.sh Executable file
View file

@ -0,0 +1,2 @@
mkdir src/node_modules
cp -rf polyfills/* src/node_modules

View file

@ -1,7 +1,7 @@
#!/bin/sh
echo "Packing asar..."
node scripts/injectPolyfills.js
./scripts/injectPolyfills.js
asar pack src app.asar # Package asar
# asar list app.asar # List asar for debugging / testing