mirror of
https://github.com/actions/setup-dotnet.git
synced 2025-08-20 15:40:20 +00:00
Undo unnecessary checks
This commit is contained in:
parent
f1fc472b7b
commit
b0977357bf
16
dist/index.js
vendored
16
dist/index.js
vendored
@ -16797,15 +16797,14 @@ class DotNetVersionInfo {
|
|||||||
constructor(version) {
|
constructor(version) {
|
||||||
this.isExactVersionSet = false;
|
this.isExactVersionSet = false;
|
||||||
this.inputVersion = version;
|
this.inputVersion = version;
|
||||||
//Note: No support for previews when using generic
|
// Check for exact match
|
||||||
let parts = version.split('.');
|
if (semver.valid(semver.clean(version) || '') != null) {
|
||||||
// Check for exact match, and that there are at least 3 parts to the version (preview/rc versions have more than 3 parts)
|
|
||||||
if (semver.valid(semver.clean(version) || '') != null &&
|
|
||||||
parts.length >= 3) {
|
|
||||||
this.fullversion = semver.clean(version);
|
this.fullversion = semver.clean(version);
|
||||||
this.isExactVersionSet = true;
|
this.isExactVersionSet = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
//Note: No support for previews when using generic
|
||||||
|
let parts = version.split('.');
|
||||||
if (parts.length < 2 || parts.length > 3)
|
if (parts.length < 2 || parts.length > 3)
|
||||||
this.throwInvalidVersionFormat();
|
this.throwInvalidVersionFormat();
|
||||||
if (parts.length == 3 && parts[2] !== 'x' && parts[2] !== '*') {
|
if (parts.length == 3 && parts[2] !== 'x' && parts[2] !== '*') {
|
||||||
@ -16902,8 +16901,8 @@ class DotnetCoreInstaller {
|
|||||||
fs_1.chmodSync(escapedScript, '777');
|
fs_1.chmodSync(escapedScript, '777');
|
||||||
const scriptPath = yield io.which(escapedScript, true);
|
const scriptPath = yield io.which(escapedScript, true);
|
||||||
let scriptArguments = [];
|
let scriptArguments = [];
|
||||||
if (this.version) {
|
if (calculatedVersion) {
|
||||||
scriptArguments.push('--version', this.version);
|
scriptArguments.push('--version', calculatedVersion);
|
||||||
}
|
}
|
||||||
// process.env must be explicitly passed in for DOTNET_INSTALL_DIR to be used
|
// process.env must be explicitly passed in for DOTNET_INSTALL_DIR to be used
|
||||||
resultCode = yield exec.exec(`"${scriptPath}"`, scriptArguments, {
|
resultCode = yield exec.exec(`"${scriptPath}"`, scriptArguments, {
|
||||||
@ -16976,7 +16975,8 @@ class DotnetCoreInstaller {
|
|||||||
releasesInfo = releasesInfo.filter((info) => {
|
releasesInfo = releasesInfo.filter((info) => {
|
||||||
// channel-version is the first 2 elements of the version (e.g. 2.1), filter out versions that don't match 2.1.x.
|
// channel-version is the first 2 elements of the version (e.g. 2.1), filter out versions that don't match 2.1.x.
|
||||||
const sdkParts = info['channel-version'].split('.');
|
const sdkParts = info['channel-version'].split('.');
|
||||||
if (versionParts.length == 2 || versionParts.length > 2 && !(versionParts[2] == 'x' || versionParts[2] == '*')) {
|
if (versionParts.length == 2 &&
|
||||||
|
!(versionParts[2] == 'x' || versionParts[2] == '*')) {
|
||||||
return versionParts[0] == sdkParts[0] && versionParts[1] == sdkParts[1];
|
return versionParts[0] == sdkParts[0] && versionParts[1] == sdkParts[1];
|
||||||
}
|
}
|
||||||
return versionParts[0] == sdkParts[0];
|
return versionParts[0] == sdkParts[0];
|
||||||
|
@ -21,20 +21,17 @@ export class DotNetVersionInfo {
|
|||||||
constructor(version: string) {
|
constructor(version: string) {
|
||||||
this.inputVersion = version;
|
this.inputVersion = version;
|
||||||
|
|
||||||
//Note: No support for previews when using generic
|
// Check for exact match
|
||||||
let parts: string[] = version.split('.');
|
if (semver.valid(semver.clean(version) || '') != null) {
|
||||||
|
|
||||||
// Check for exact match, and that there are at least 3 parts to the version (preview/rc versions have more than 3 parts)
|
|
||||||
if (
|
|
||||||
semver.valid(semver.clean(version) || '') != null &&
|
|
||||||
parts.length >= 3
|
|
||||||
) {
|
|
||||||
this.fullversion = semver.clean(version) as string;
|
this.fullversion = semver.clean(version) as string;
|
||||||
this.isExactVersionSet = true;
|
this.isExactVersionSet = true;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Note: No support for previews when using generic
|
||||||
|
let parts: string[] = version.split('.');
|
||||||
|
|
||||||
if (parts.length < 2 || parts.length > 3) this.throwInvalidVersionFormat();
|
if (parts.length < 2 || parts.length > 3) this.throwInvalidVersionFormat();
|
||||||
|
|
||||||
if (parts.length == 3 && parts[2] !== 'x' && parts[2] !== '*') {
|
if (parts.length == 3 && parts[2] !== 'x' && parts[2] !== '*') {
|
||||||
@ -149,8 +146,8 @@ export class DotnetCoreInstaller {
|
|||||||
const scriptPath = await io.which(escapedScript, true);
|
const scriptPath = await io.which(escapedScript, true);
|
||||||
|
|
||||||
let scriptArguments: string[] = [];
|
let scriptArguments: string[] = [];
|
||||||
if (this.version) {
|
if (calculatedVersion) {
|
||||||
scriptArguments.push('--version', this.version);
|
scriptArguments.push('--version', calculatedVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
// process.env must be explicitly passed in for DOTNET_INSTALL_DIR to be used
|
// process.env must be explicitly passed in for DOTNET_INSTALL_DIR to be used
|
||||||
@ -260,9 +257,8 @@ export class DotnetCoreInstaller {
|
|||||||
// channel-version is the first 2 elements of the version (e.g. 2.1), filter out versions that don't match 2.1.x.
|
// channel-version is the first 2 elements of the version (e.g. 2.1), filter out versions that don't match 2.1.x.
|
||||||
const sdkParts: string[] = info['channel-version'].split('.');
|
const sdkParts: string[] = info['channel-version'].split('.');
|
||||||
if (
|
if (
|
||||||
versionParts.length == 2 ||
|
versionParts.length == 2 &&
|
||||||
(versionParts.length > 2 &&
|
!(versionParts[2] == 'x' || versionParts[2] == '*')
|
||||||
!(versionParts[2] == 'x' || versionParts[2] == '*'))
|
|
||||||
) {
|
) {
|
||||||
return versionParts[0] == sdkParts[0] && versionParts[1] == sdkParts[1];
|
return versionParts[0] == sdkParts[0] && versionParts[1] == sdkParts[1];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user