nx-ignore
Advanced tools
Comparing version 17.0.0 to 17.2.0
{ | ||
"name": "nx-ignore", | ||
"version": "17.0.0", | ||
"version": "17.2.0", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -21,2 +21,3 @@ #!/usr/bin/env node | ||
declare function installTempNx(root: string, plugins: string[]): string | null; | ||
declare function isPackageManagerInstalled(pm: 'yarn' | 'pnpm'): boolean; | ||
declare function commitHasSkipMessage(message: string): boolean; | ||
@@ -23,0 +24,0 @@ declare function commitHasForceDeployMessage(message: string): boolean; |
@@ -127,7 +127,9 @@ #!/usr/bin/env node | ||
writeFileSync(join(tmpPath, 'package.json'), JSON.stringify(json)); | ||
if (existsSync(join(root, 'yarn.lock'))) { | ||
if (existsSync(join(root, 'yarn.lock')) && isPackageManagerInstalled(`yarn`)) { | ||
logDebug(`Using yarn to install Nx.`); | ||
execSync(`yarn install`, { | ||
cwd: tmpPath | ||
}); | ||
} else if (existsSync(join(root, 'pnpm-lock.yaml'))) { | ||
} else if (existsSync(join(root, 'pnpm-lock.yaml')) && isPackageManagerInstalled(`pnpm`)) { | ||
logDebug(`Using pnpm to install Nx.`); | ||
execSync(`pnpm install --force`, { | ||
@@ -137,2 +139,3 @@ cwd: tmpPath | ||
} else { | ||
logDebug(`Using npm to install Nx.`); | ||
execSync(`npm install --force`, { | ||
@@ -149,2 +152,15 @@ cwd: tmpPath | ||
} | ||
function isPackageManagerInstalled(pm) { | ||
try { | ||
var _execSync; | ||
const version = (_execSync = execSync(`${pm} --version`, { | ||
stdio: 'pipe' | ||
})) == null ? void 0 : _execSync.toString(); | ||
logDebug(`Found ${pm} version ${version}.`); | ||
return true; | ||
} catch (e) { | ||
logDebug(`Could not find ${pm}. Check that it is installed.`); | ||
return false; | ||
} | ||
} | ||
function commitHasSkipMessage(message) { | ||
@@ -151,0 +167,0 @@ return [ |
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
24930
210