Call addToPath method on DotnetInstallDir directly

This commit is contained in:
Nikolai Laevskii 2023-05-30 12:19:28 +02:00
parent defac2491f
commit 89b480a0df
3 changed files with 3 additions and 6 deletions

3
dist/index.js vendored
View File

@ -463,7 +463,6 @@ class DotnetCoreInstaller {
} }
} }
exports.DotnetCoreInstaller = DotnetCoreInstaller; exports.DotnetCoreInstaller = DotnetCoreInstaller;
DotnetCoreInstaller.addToPath = DotnetInstallDir.addToPath;
(() => { (() => {
DotnetInstallDir.setEnvironmentVariable(); DotnetInstallDir.setEnvironmentVariable();
})(); })();
@ -571,7 +570,7 @@ function run() {
const installedVersion = yield dotnetInstaller.installDotnet(); const installedVersion = yield dotnetInstaller.installDotnet();
installedDotnetVersions.push(installedVersion); installedDotnetVersions.push(installedVersion);
} }
installer_1.DotnetCoreInstaller.addToPath(); installer_1.DotnetInstallDir.addToPath();
} }
const sourceUrl = core.getInput('source-url'); const sourceUrl = core.getInput('source-url');
const configFile = core.getInput('config-file'); const configFile = core.getInput('config-file');

View File

@ -246,8 +246,6 @@ export abstract class DotnetInstallDir {
} }
export class DotnetCoreInstaller { export class DotnetCoreInstaller {
static addToPath = DotnetInstallDir.addToPath;
static { static {
DotnetInstallDir.setEnvironmentVariable(); DotnetInstallDir.setEnvironmentVariable();
} }

View File

@ -1,5 +1,5 @@
import * as core from '@actions/core'; import * as core from '@actions/core';
import {DotnetCoreInstaller} from './installer'; import {DotnetCoreInstaller, DotnetInstallDir} from './installer';
import * as fs from 'fs'; import * as fs from 'fs';
import path from 'path'; import path from 'path';
import semver from 'semver'; import semver from 'semver';
@ -69,7 +69,7 @@ export async function run() {
const installedVersion = await dotnetInstaller.installDotnet(); const installedVersion = await dotnetInstaller.installDotnet();
installedDotnetVersions.push(installedVersion); installedDotnetVersions.push(installedVersion);
} }
DotnetCoreInstaller.addToPath(); DotnetInstallDir.addToPath();
} }
const sourceUrl: string = core.getInput('source-url'); const sourceUrl: string = core.getInput('source-url');