Skip to content

Commit

Permalink
chore: 🤖 update
Browse files Browse the repository at this point in the history
  • Loading branch information
theowenyoung committed Jan 29, 2021
1 parent 4042c62 commit 7f735ba
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6540,12 +6540,16 @@ const exec = __importStar(__webpack_require__(514));
const get_latest_version_1 = __webpack_require__(787);
const installer_1 = __webpack_require__(70);
const constants_1 = __webpack_require__(825);
const os_1 = __importDefault(__webpack_require__(87));
const fs_1 = __importDefault(__webpack_require__(747));
const path_1 = __importDefault(__webpack_require__(622));
const fs = fs_1.default.promises;
function showVersion(cmd, args) {
return __awaiter(this, void 0, void 0, function* () {
const actRcPath = '.actrc';
const isActRcExist = fs_1.default.existsSync(actRcPath);
if (!isActRcExist) {
const actRC = `-P ubuntu-latest=node:12.6-buster-slim\n-P ubuntu-20.04=node:12.6-buster-slim\n-P ubuntu-18.04=node:12.6-buster-slim\n-P ubuntu-16.04=node:12.6-stretch-slim`;
yield fs.writeFile(actRcPath, actRC);
}
const result = {
exitcode: 0,
output: ''
Expand All @@ -6561,6 +6565,9 @@ function showVersion(cmd, args) {
core.debug(`command: ${cmd} ${args}`);
core.debug(`exit code: ${result.exitcode}`);
core.debug(`stdout: ${result.output}`);
if (!isActRcExist) {
yield fs.unlink(actRcPath);
}
return result;
});
}
Expand All @@ -6586,16 +6593,7 @@ function run(options) {
}
core.info(`${constants_1.Tool.Name} version: ${installVersion}`);
yield installer_1.installer(installVersion);
const actRcPath = path_1.default.resolve(os_1.default.homedir(), '.actrc');
const isActRcExist = fs_1.default.existsSync(actRcPath);
if (!isActRcExist) {
const actRC = `-P ubuntu-latest=node:12.6-buster-slim\n-P ubuntu-20.04=node:12.6-buster-slim\n-P ubuntu-18.04=node:12.6-buster-slim\n-P ubuntu-16.04=node:12.6-stretch-slim`;
yield fs.writeFile(actRcPath, actRC);
}
result = yield showVersion(constants_1.Tool.CmdName, [constants_1.Tool.CmdOptVersion]);
if (!isActRcExist) {
yield fs.unlink(actRcPath);
}
return result;
});
}
Expand Down

0 comments on commit 7f735ba

Please sign in to comment.