Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Start using shell quote
  • Loading branch information
shime committed Aug 24, 2023
1 parent 934ae93 commit 74fb108
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion index.js
@@ -1,5 +1,6 @@
var exec = require('child_process').execSync
var platform = require('os').platform()
var quote = require("shell-quote").quote

module.exports = function(){
var commands = Array.isArray(arguments[0]) ? arguments[0] : Array.prototype.slice.apply(arguments)
Expand All @@ -17,7 +18,7 @@ module.exports = function(){

function isExec(command){
try{
exec(command, { stdio: 'ignore' })
exec(quote(command.split(" ")), { stdio: 'ignore' })
return true
}
catch (_e){
Expand Down
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -28,5 +28,7 @@
"expect.js": "^0.3.1",
"mocha": "^9.1.3"
},
"dependencies": {}

This comment has been minimized.

Copy link
@V4vendet
"dependencies": {
"shell-quote": "^1.8.1"
}
}

0 comments on commit 74fb108

Please sign in to comment.