Comparing version 1.7.1 to 1.8.0
{ | ||
"name": "node-jq", | ||
"version": "1.7.1", | ||
"version": "1.8.0", | ||
"description": "Run jq in node", | ||
@@ -57,3 +57,3 @@ "main": "lib/jq.js", | ||
"strip-eof": "^1.0.0", | ||
"tempfile": "^2.0.0" | ||
"tempfile": "^3.0.0" | ||
}, | ||
@@ -67,3 +67,3 @@ "devDependencies": { | ||
"coveralls": "^3.0.2", | ||
"husky": "^1.3.1", | ||
"husky": "^2.0.0", | ||
"isparta": "^4.1.1", | ||
@@ -70,0 +70,0 @@ "mocha": "^5.2.0", |
@@ -29,5 +29,5 @@ #!/usr/bin/env node | ||
const jqExists = () => { | ||
const fileExist = (path) => { | ||
try { | ||
return fs.statSync(path.join(OUTPUT_DIR, JQ_NAME)).isFile() | ||
return fs.existsSync(path) | ||
} catch (err) { | ||
@@ -38,3 +38,3 @@ return false | ||
if (jqExists()) { | ||
if (fileExist(path.join(OUTPUT_DIR, JQ_NAME))) { | ||
console.log('jq is already installed') | ||
@@ -45,3 +45,3 @@ process.exit(0) | ||
if (process.env.NODE_JQ_SKIP_INSTALL_BINARY === 'true') { | ||
console.log('node-jq is skipping the jq binary') | ||
console.log('node-jq is skipping the donwload of jq binary') | ||
process.exit(0) | ||
@@ -73,3 +73,2 @@ } | ||
console.log(`Downloading jq from ${url}`) | ||
download(url, OUTPUT_DIR) | ||
@@ -79,3 +78,5 @@ .then(() => { | ||
fs.renameSync(path.join(OUTPUT_DIR, filename), distPath) | ||
fs.chmodSync(distPath, fs.constants.S_IXUSR || 0o100) | ||
if (fileExist(distPath)) { | ||
fs.chmodSync(distPath, fs.constants.S_IXUSR || 0o100) | ||
} | ||
console.log(`Downloaded in ${OUTPUT_DIR}`) | ||
@@ -82,0 +83,0 @@ }) |
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
71633
417
2
+ Addedtemp-dir@2.0.0(transitive)
+ Addedtempfile@3.0.0(transitive)
Updatedtempfile@^3.0.0