Browse Source

Added linux support npm run

pull/9/head
pb 2 years ago
parent
commit
3f80ec0631
2 changed files with 7 additions and 3 deletions
  1. 5
    2
      bin/elxr
  2. 2
    1
      package.json

+ 5
- 2
bin/elxr View File

const spawn = require('child_process').spawn; const spawn = require('child_process').spawn;
console.dir(process.argv.slice(2)) console.dir(process.argv.slice(2))


let npmcmd = (process.platform === 'win32' ? 'npm.cmd' : 'npm')
let npmrun = (process.platform === 'win32' ? ['run', 'index', '--'] : ['run', 'index_linux', '--'])

const child = spawn( const child = spawn(
(process.platform === 'win32' ? 'npm.cmd' : 'npm')
, ['run', 'index', '--'].concat(process.argv.slice(2)), { env : Object.assign({}, process.env, {wd: process.cwd()}), cwd: __dirname });
npmcmd
, npmrun.concat(process.argv.slice(2)), { env : Object.assign({}, process.env, {wd: process.cwd()}), cwd: __dirname });


// const child = spawn( // const child = spawn(
// 'C:\\Program Files\\Git\\bin\\sh.exe' // 'C:\\Program Files\\Git\\bin\\sh.exe'

+ 2
- 1
package.json View File

"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"build-elxr": "rollup index.js --format cjs --file elxr.js", "build-elxr": "rollup index.js --format cjs --file elxr.js",
"build": "rollup -c && rollup index.js --format cjs --file elxr.js", "build": "rollup -c && rollup index.js --format cjs --file elxr.js",
"index": "SET FORCE_COLOR=true && node index"
"index": "SET FORCE_COLOR=true && node index",
"index_linux": "FORCE_COLOR=true node index"
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",

Loading…
Cancel
Save