Rebuild solution

This commit is contained in:
IvanZosimov 2023-05-15 11:49:01 +02:00
parent 0bc43909e0
commit fbdbede901
1 changed files with 9 additions and 25 deletions

34
dist/index.js vendored
View File

@ -238,7 +238,6 @@ const exec = __importStar(__nccwpck_require__(1514));
const io = __importStar(__nccwpck_require__(7436)); const io = __importStar(__nccwpck_require__(7436));
const hc = __importStar(__nccwpck_require__(6255)); const hc = __importStar(__nccwpck_require__(6255));
const fs_1 = __nccwpck_require__(7147); const fs_1 = __nccwpck_require__(7147);
const promises_1 = __nccwpck_require__(3292);
const path_1 = __importDefault(__nccwpck_require__(1017)); const path_1 = __importDefault(__nccwpck_require__(1017));
const os_1 = __importDefault(__nccwpck_require__(2037)); const os_1 = __importDefault(__nccwpck_require__(2037));
const semver_1 = __importDefault(__nccwpck_require__(5911)); const semver_1 = __importDefault(__nccwpck_require__(5911));
@ -377,7 +376,6 @@ class DotnetCoreInstaller {
} }
installDotnet() { installDotnet() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const listOfInstalledVersions = yield this.getListOfInstalledVersions();
const windowsDefaultOptions = [ const windowsDefaultOptions = [
'-NoLogo', '-NoLogo',
'-Sta', '-Sta',
@ -430,26 +428,20 @@ class DotnetCoreInstaller {
ignoreReturnCode: true, ignoreReturnCode: true,
env: process.env env: process.env
}; };
const { exitCode, stderr } = yield exec.getExecOutput(`"${scriptPath}"`, scriptArguments, getExecOutputOptions); const { exitCode, stdout, stderr } = yield exec.getExecOutput(`"${scriptPath}"`, scriptArguments, getExecOutputOptions);
if (exitCode) { if (exitCode) {
throw new Error(`Failed to install dotnet, exit code: ${exitCode}. ${stderr}`); throw new Error(`Failed to install dotnet, exit code: ${exitCode}. ${stderr}`);
} }
return this.outputDotnetVersion(listOfInstalledVersions); return this.parseInstalledVersion(stdout);
}); });
} }
getListOfInstalledVersions() { parseInstalledVersion(stdout) {
return __awaiter(this, void 0, void 0, function* () { const regex = /(?<version>\d+\.\d+\.\d+[a-z0-9._-]*)/gm;
const installationPath = process.env['DOTNET_INSTALL_DIR']; const matchedResult = regex.exec(stdout);
const versionsOnRunner = (yield (0, promises_1.readdir)(path_1.default.join(installationPath.replace(/'/g, ''), 'sdk'))).filter((el) => semver_1.default.valid(el)); if (!matchedResult) {
return versionsOnRunner; throw new Error(`Failed to parse installed by the script version of .NET`);
}); }
} return matchedResult.groups.version;
outputDotnetVersion(listOfInstalledVersions) {
return __awaiter(this, void 0, void 0, function* () {
const updatedListOfInstalledVersions = yield this.getListOfInstalledVersions();
const installedVersion = updatedListOfInstalledVersions.filter((el) => !listOfInstalledVersions.includes(el));
return installedVersion[0];
});
} }
} }
exports.DotnetCoreInstaller = DotnetCoreInstaller; exports.DotnetCoreInstaller = DotnetCoreInstaller;
@ -21120,14 +21112,6 @@ module.exports = require("fs");
/***/ }), /***/ }),
/***/ 3292:
/***/ ((module) => {
"use strict";
module.exports = require("fs/promises");
/***/ }),
/***/ 3685: /***/ 3685:
/***/ ((module) => { /***/ ((module) => {