mirror of
https://github.com/actions/setup-node.git
synced 2025-11-27 21:24:51 +08:00
Added option to enable corepack (#1)
Co-authored-by: Steven <steven@ceriously.com> Co-authored-by: Sayak Mukhopadhyay <mukhopadhyaysayak@gmail.com> Co-authored-by: Jacob Parish <jacob.parish.1@gmail.com>
This commit is contained in:
committed by
GitHub
parent
5ef044f9d0
commit
2936fe8cda
17
dist/cache-save/index.js
vendored
17
dist/cache-save/index.js
vendored
@@ -83321,7 +83321,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.unique = exports.printEnvDetailsAndSetOutput = exports.parseNodeVersionFile = void 0;
|
||||
exports.enableCorepack = exports.unique = exports.printEnvDetailsAndSetOutput = exports.parseNodeVersionFile = void 0;
|
||||
const core = __importStar(__nccwpck_require__(2186));
|
||||
const exec = __importStar(__nccwpck_require__(1514));
|
||||
function parseNodeVersionFile(contents) {
|
||||
@@ -83393,6 +83393,21 @@ const unique = () => {
|
||||
};
|
||||
};
|
||||
exports.unique = unique;
|
||||
function enableCorepack(input) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const corepackArgs = ['enable'];
|
||||
if (input.length > 0 && input !== 'false') {
|
||||
if (input !== 'true') {
|
||||
const packageManagers = input.split(' ');
|
||||
corepackArgs.push(...packageManagers);
|
||||
}
|
||||
yield exec.getExecOutput('corepack', corepackArgs, {
|
||||
ignoreReturnCode: true
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.enableCorepack = enableCorepack;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
Reference in New Issue
Block a user