nx-ignore
Advanced tools
Comparing version 0.0.13 to 0.0.14
{ | ||
"name": "nx-ignore", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"bin": { | ||
@@ -5,0 +5,0 @@ "nx-ignore": "./src/index.js" |
@@ -14,2 +14,4 @@ #!/usr/bin/env node | ||
const project = process.argv[2]; | ||
console.log('>>> resolve', resolved); | ||
@@ -23,8 +25,9 @@ const { affected } = require('nx/src/command-line/affected'); | ||
// hijack conosle.log for now | ||
let result = ''; | ||
let result = null; | ||
const _log = console.log; | ||
try { | ||
let output = ''; | ||
console.log = x => { | ||
_log('>>> got', x) | ||
result = x; | ||
output = x; | ||
}; | ||
@@ -37,2 +40,4 @@ await affected('print-affected', { | ||
console.log = _log; | ||
result = JSON.parse(output); | ||
} catch (e) { | ||
@@ -43,3 +48,11 @@ console.log = _log; | ||
} | ||
if (result.projects.includes(project)) { | ||
console.log(`>>> ✅ - Build can proceed since ${project} is affected`); | ||
process.exit(1); | ||
} else { | ||
console.log(`>>> 🛑 - Build cancelled since ${project} is not affected`); | ||
process.exit(0); | ||
} | ||
} | ||
//# sourceMappingURL=index.js.map |
6067
50