@nrwl/tao
Advanced tools
Comparing version 8.5.0-beta.6 to 8.5.0-beta.7
{ | ||
"name": "@nrwl/tao", | ||
"version": "8.5.0-beta.6", | ||
"version": "8.5.0-beta.7", | ||
"description": "CLI for generating code and running commands", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -20,2 +20,3 @@ "use strict"; | ||
const minimist = require("minimist"); | ||
const child_process_1 = require("child_process"); | ||
function throwInvalidInvocation() { | ||
@@ -109,15 +110,35 @@ throw new Error(`Specify the schematic name (e.g., ${print_help_1.commandName} generate collection-name:schematic-name)`); | ||
} | ||
const yarnLockFileExists = yield host.exists('yarn.lock').toPromise(); | ||
if (yarnLockFileExists) { | ||
if (yield fileExists(host, 'yarn.lock')) { | ||
return 'yarn'; | ||
} | ||
const pnpmLockFileExists = yield host | ||
.exists('pnpm-lock.yaml') | ||
.toPromise(); | ||
if (pnpmLockFileExists) { | ||
if (yield fileExists(host, 'pnpm-lock.yaml')) { | ||
return 'pnpm'; | ||
} | ||
if (yield fileExists(host, 'package-lock.json')) { | ||
return 'npm'; | ||
} | ||
// If we get here, there are no lock files, so lets check for package managers in our preferred order | ||
if (isPackageManagerInstalled('yarn')) { | ||
return 'yarn'; | ||
} | ||
if (isPackageManagerInstalled('pnpm')) { | ||
return 'pnpm'; | ||
} | ||
return 'npm'; | ||
}); | ||
} | ||
function fileExists(host, fileName) { | ||
return host.exists(fileName).toPromise(); | ||
} | ||
function isPackageManagerInstalled(packageManager) { | ||
try { | ||
child_process_1.execSync(`${packageManager} --version`, { | ||
stdio: ['ignore', 'ignore', 'ignore'] | ||
}); | ||
return true; | ||
} | ||
catch (e) { | ||
return false; | ||
} | ||
} | ||
function createWorkflow(fsHost, root, opts) { | ||
@@ -124,0 +145,0 @@ return __awaiter(this, void 0, void 0, function* () { |
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
69311
1430
3