mirror of
https://github.com/actions/setup-dotnet.git
synced 2025-08-18 06:35:09 +00:00
Fix review points
This commit is contained in:
parent
c32f58ecce
commit
5719647987
@ -26,3 +26,4 @@ jobs:
|
||||
with:
|
||||
source-tag: ${{ env.TAG_NAME }}
|
||||
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
|
||||
|
8
dist/index.js
vendored
8
dist/index.js
vendored
@ -212,7 +212,7 @@ class DotnetVersionResolver {
|
||||
}
|
||||
resolveVersionInput() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (!this.isValidVersion(this.inputVersion)) {
|
||||
if (!semver_1.default.validRange(this.inputVersion)) {
|
||||
throw new Error(`'dotnet-version' was supplied in invalid format: ${this.inputVersion}! Supported syntax: A.B.C, A.B, A.B.x, A, A.x`);
|
||||
}
|
||||
if (semver_1.default.valid(this.inputVersion)) {
|
||||
@ -238,9 +238,6 @@ class DotnetVersionResolver {
|
||||
}
|
||||
});
|
||||
}
|
||||
isValidVersion(version) {
|
||||
return semver_1.default.valid(version) || semver_1.default.validRange(version) ? true : false;
|
||||
}
|
||||
isNumericTag(versionTag) {
|
||||
return /^\d+$/.test(versionTag);
|
||||
}
|
||||
@ -358,7 +355,8 @@ class DotnetCoreInstaller {
|
||||
}
|
||||
scriptArguments.push(`-InstallDir '${DotnetCoreInstaller.installationDirectoryWindows}'`);
|
||||
// process.env must be explicitly passed in for DOTNET_INSTALL_DIR to be used
|
||||
scriptPath = yield io.which('powershell', true);
|
||||
scriptPath =
|
||||
(yield io.which('powershell', false)) || (yield io.which('pwsh', true));
|
||||
scriptArguments = [...windowsDefaultOptions, scriptArguments.join(' ')];
|
||||
}
|
||||
else {
|
||||
|
@ -42,7 +42,7 @@ export class DotnetVersionResolver {
|
||||
}
|
||||
|
||||
private async resolveVersionInput(): Promise<void> {
|
||||
if (!this.isValidVersion(this.inputVersion)) {
|
||||
if (!semver.validRange(this.inputVersion)) {
|
||||
throw new Error(
|
||||
`'dotnet-version' was supplied in invalid format: ${this.inputVersion}! Supported syntax: A.B.C, A.B, A.B.x, A, A.x`
|
||||
);
|
||||
@ -72,10 +72,6 @@ export class DotnetVersionResolver {
|
||||
}
|
||||
}
|
||||
|
||||
private isValidVersion(version) {
|
||||
return semver.valid(version) || semver.validRange(version) ? true : false;
|
||||
}
|
||||
|
||||
private isNumericTag(versionTag): Boolean {
|
||||
return /^\d+$/.test(versionTag);
|
||||
}
|
||||
@ -237,7 +233,8 @@ export class DotnetCoreInstaller {
|
||||
`-InstallDir '${DotnetCoreInstaller.installationDirectoryWindows}'`
|
||||
);
|
||||
// process.env must be explicitly passed in for DOTNET_INSTALL_DIR to be used
|
||||
scriptPath = await io.which('powershell', true);
|
||||
scriptPath =
|
||||
(await io.which('powershell', false)) || (await io.which('pwsh', true));
|
||||
scriptArguments = [...windowsDefaultOptions, scriptArguments.join(' ')];
|
||||
} else {
|
||||
chmodSync(escapedScript, '777');
|
||||
|
Loading…
x
Reference in New Issue
Block a user