Comparing version 1.5.3 to 1.5.4
20
index.js
@@ -8,3 +8,20 @@ 'use strict'; | ||
const spawn = require('child_process').spawn; | ||
const spawnSync = require('child_process').spawnSync; | ||
function isCmd() { | ||
if (process.platform !== 'win32') { | ||
return false | ||
} | ||
try { | ||
const result = spawnSync(`ls`, { | ||
stdio: 'pipe', | ||
}) | ||
return result.error !== undefined | ||
} catch (err) { | ||
return true | ||
} | ||
} | ||
/** | ||
@@ -40,3 +57,4 @@ * Run shell script in child process | ||
const splits = script.split(' '); | ||
splits[0] = path.join(options.cwd, splits[0]); | ||
// in bash C:\Windows\system32 -> C:\\Windows\\system32 | ||
splits[0] = path.join(isCmd() ? options.cwd : path.normalize(options.cwd), splits[0]); | ||
script = splits.join(' '); | ||
@@ -43,0 +61,0 @@ } |
{ | ||
"name": "runscript", | ||
"version": "1.5.3", | ||
"version": "1.5.4", | ||
"description": "Run script easy!", | ||
@@ -11,8 +11,6 @@ "main": "index.js", | ||
"scripts": { | ||
"contributor": "git-contributor", | ||
"test": "npm run lint && egg-bin test", | ||
"test-cov": "egg-bin cov", | ||
"lint": "eslint index.js test --fix", | ||
"ci": "npm run lint && npm run test-cov", | ||
"autod": "autod -w --prefix '^'" | ||
"ci": "npm run lint && npm run test-cov" | ||
}, | ||
@@ -27,6 +25,4 @@ "dependencies": { | ||
"egg-bin": "^1.11.1", | ||
"egg-ci": "^1.8.0", | ||
"eslint": "^4.19.1", | ||
"eslint-config-egg": "^6.0.0", | ||
"git-contributor": "^1.0.10", | ||
"typescript": "^3.9.3" | ||
@@ -51,9 +47,4 @@ }, | ||
}, | ||
"ci": { | ||
"version": "8, 10, 12, 14, 16", | ||
"type": "github", | ||
"npminstall": false | ||
}, | ||
"author": "fengmk2 <fengmk2@gmail.com> (https://fengmk2.com)", | ||
"author": "fengmk2 <fengmk2@gmail.com> (https://github.com/fengmk2)", | ||
"license": "MIT" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6
156
10215
5
2