create-nx-workspace
Advanced tools
Comparing version
{ | ||
"name": "create-nx-workspace", | ||
"version": "0.0.0-pr-32306-72a6d61", | ||
"version": "0.0.0-pr-32422-a3285be", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "Smart Repos · Fast Builds", |
@@ -5,3 +5,3 @@ /** | ||
export declare function spawnAndWait(command: string, args: string[], cwd: string): Promise<unknown>; | ||
export declare function execAndWait(command: string, cwd: string): Promise<{ | ||
export declare function execAndWait(command: string, cwd: string, silenceErrors?: boolean): Promise<{ | ||
code: number; | ||
@@ -8,0 +8,0 @@ stdout: string; |
@@ -37,10 +37,15 @@ "use strict"; | ||
} | ||
function execAndWait(command, cwd) { | ||
function execAndWait(command, cwd, silenceErrors = false) { | ||
return new Promise((res, rej) => { | ||
(0, child_process_1.exec)(command, { cwd, env: { ...process.env, NX_DAEMON: 'false' }, windowsHide: false }, (error, stdout, stderr) => { | ||
if (error) { | ||
const logFile = (0, path_1.join)(cwd, 'error.log'); | ||
(0, fs_1.writeFileSync)(logFile, `${stdout}\n${stderr}`); | ||
const message = stderr && stderr.trim().length ? stderr : stdout; | ||
rej(new error_utils_1.CreateNxWorkspaceError(message, error.code, logFile)); | ||
if (silenceErrors) { | ||
rej(); | ||
} | ||
else { | ||
const logFile = (0, path_1.join)(cwd, 'error.log'); | ||
(0, fs_1.writeFileSync)(logFile, `${stdout}\n${stderr}`); | ||
const message = stderr && stderr.trim().length ? stderr : stdout; | ||
rej(new error_utils_1.CreateNxWorkspaceError(message, error.code, logFile)); | ||
} | ||
} | ||
@@ -47,0 +52,0 @@ else { |
@@ -101,3 +101,3 @@ "use strict"; | ||
} | ||
const insideRepo = await (0, child_process_utils_1.execAndWait)('git rev-parse --is-inside-work-tree', directory).then(() => true, () => false); | ||
const insideRepo = await (0, child_process_utils_1.execAndWait)('git rev-parse --is-inside-work-tree', directory, true).then(() => true, () => false); | ||
if (insideRepo) { | ||
@@ -104,0 +104,0 @@ output_1.output.log({ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
145033
0.14%3453
0.15%