Comparing version 14.0.4-beta.3 to 14.0.4-beta.4
@@ -205,8 +205,9 @@ "use strict"; | ||
(0, fs_1.writeFileSync)(lockFilePath, ''); | ||
process.on('exit', () => cleanupAgentLockfile(lockFilePath)); | ||
process.on('SIGINT', () => cleanupAgentLockfile(lockFilePath)); | ||
process.on('exit', (code) => cleanupAgentLockfile(lockFilePath, code)); | ||
process.on('SIGINT', () => cleanupAgentLockfile(lockFilePath, 0)); | ||
} | ||
function cleanupAgentLockfile(lockFilePath) { | ||
function cleanupAgentLockfile(lockFilePath, code) { | ||
if ((0, fs_1.existsSync)(lockFilePath)) { | ||
(0, fs_1.unlinkSync)(lockFilePath); | ||
process.exit(code); | ||
} | ||
@@ -213,0 +214,0 @@ } |
@@ -6,9 +6,38 @@ "use strict"; | ||
function printMessage(message) { | ||
// the new format uses a different offset, so we need to make sure it works with both | ||
let offset = ' '; | ||
if (newTerminalOutput()) { | ||
process.stdout.write(` ${formatMessage(message)}`); | ||
output.addNewline(); | ||
output.addNewline(); | ||
} | ||
else { | ||
if (runOneCommand()) { | ||
output.addNewline(); | ||
process.stdout.write(`${formatMessage(message)}`); | ||
output.addNewline(); | ||
output.addNewline(); | ||
} | ||
else { | ||
process.stdout.write(` ${formatMessage(message)}`); | ||
output.addNewline(); | ||
output.addNewline(); | ||
} | ||
} | ||
} | ||
exports.printMessage = printMessage; | ||
function newTerminalOutput() { | ||
try { | ||
require('nx/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle'); | ||
offset = ' '; | ||
return true; | ||
} | ||
catch (e) { } | ||
catch (e) { | ||
try { | ||
require('@nrwl/workspace/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle'); | ||
return true; | ||
} | ||
catch (ee) { | ||
return false; | ||
} | ||
} | ||
} | ||
function formatMessage(message) { | ||
let formattedMessage; | ||
@@ -19,3 +48,3 @@ // TODO(Altan): Remove after Nx 15-ish | ||
if (typeof output.dim === 'function') { | ||
formattedMessage = output.dim(message); | ||
return output.dim(message); | ||
} | ||
@@ -25,14 +54,14 @@ else { | ||
// Old (pre 13.4/13.5) method | ||
formattedMessage = output.colors.gray(message); | ||
return output.colors.gray(message); | ||
} | ||
catch (e) { | ||
// Ultra fallback, we should never hit this | ||
formattedMessage = message; | ||
return message; | ||
} | ||
} | ||
process.stdout.write(`${offset}${formattedMessage}`); | ||
output.addNewline(); | ||
output.addNewline(); | ||
} | ||
exports.printMessage = printMessage; | ||
function runOneCommand() { | ||
return (process.argv.indexOf('run-many') === -1 && | ||
process.argv.indexOf('affected') === -1); | ||
} | ||
//# sourceMappingURL=print-message.js.map |
{ | ||
"name": "nx-cloud", | ||
"version": "14.0.4-beta.3", | ||
"version": "14.0.4-beta.4", | ||
"description": "Nx Cloud plugin for Nx", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
251066
3294