mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2024-11-22 12:00:58 -05:00
Only include npm version if npm exists
This commit is contained in:
parent
e99a7e62b2
commit
ffde538781
2 changed files with 10 additions and 4 deletions
3
dist/index.js
vendored
3
dist/index.js
vendored
|
@ -15228,8 +15228,11 @@ function run() {
|
||||||
const nodeVersion = child_process_1.default.execSync(`${nodePath} --version`);
|
const nodeVersion = child_process_1.default.execSync(`${nodePath} --version`);
|
||||||
console.log(`Node Version: ${nodeVersion}`);
|
console.log(`Node Version: ${nodeVersion}`);
|
||||||
const npmPath = yield io.which('npm');
|
const npmPath = yield io.which('npm');
|
||||||
|
// Older versions of Node don't include npm
|
||||||
|
if (npmPath) {
|
||||||
const npmVersion = child_process_1.default.execSync(`${npmPath} --version`);
|
const npmVersion = child_process_1.default.execSync(`${npmPath} --version`);
|
||||||
console.log(`npm Version: ${npmVersion}`);
|
console.log(`npm Version: ${npmVersion}`);
|
||||||
|
}
|
||||||
const registryUrl = core.getInput('registry-url');
|
const registryUrl = core.getInput('registry-url');
|
||||||
const alwaysAuth = core.getInput('always-auth');
|
const alwaysAuth = core.getInput('always-auth');
|
||||||
if (registryUrl) {
|
if (registryUrl) {
|
||||||
|
|
|
@ -25,8 +25,11 @@ async function run() {
|
||||||
console.log(`Node Version: ${nodeVersion}`);
|
console.log(`Node Version: ${nodeVersion}`);
|
||||||
|
|
||||||
const npmPath = await io.which('npm');
|
const npmPath = await io.which('npm');
|
||||||
|
// Older versions of Node don't include npm
|
||||||
|
if (npmPath) {
|
||||||
const npmVersion = cp.execSync(`${npmPath} --version`);
|
const npmVersion = cp.execSync(`${npmPath} --version`);
|
||||||
console.log(`npm Version: ${npmVersion}`);
|
console.log(`npm Version: ${npmVersion}`);
|
||||||
|
}
|
||||||
|
|
||||||
const registryUrl: string = core.getInput('registry-url');
|
const registryUrl: string = core.getInput('registry-url');
|
||||||
const alwaysAuth: string = core.getInput('always-auth');
|
const alwaysAuth: string = core.getInput('always-auth');
|
||||||
|
|
Loading…
Reference in a new issue