Skip to content

Commit

Permalink
Call addToPath method on DotnetInstallDir directly
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolai Laevskii committed May 30, 2023
1 parent defac24 commit 89b480a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,6 @@ class DotnetCoreInstaller {
}
}
exports.DotnetCoreInstaller = DotnetCoreInstaller;
DotnetCoreInstaller.addToPath = DotnetInstallDir.addToPath;
(() => {
DotnetInstallDir.setEnvironmentVariable();
})();
Expand Down Expand Up @@ -571,7 +570,7 @@ function run() {
const installedVersion = yield dotnetInstaller.installDotnet();
installedDotnetVersions.push(installedVersion);
}
installer_1.DotnetCoreInstaller.addToPath();
installer_1.DotnetInstallDir.addToPath();
}
const sourceUrl = core.getInput('source-url');
const configFile = core.getInput('config-file');
Expand Down
2 changes: 0 additions & 2 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,6 @@ export abstract class DotnetInstallDir {
}

export class DotnetCoreInstaller {
static addToPath = DotnetInstallDir.addToPath;

static {
DotnetInstallDir.setEnvironmentVariable();
}
Expand Down
4 changes: 2 additions & 2 deletions src/setup-dotnet.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as core from '@actions/core';
import {DotnetCoreInstaller} from './installer';
import {DotnetCoreInstaller, DotnetInstallDir} from './installer';
import * as fs from 'fs';
import path from 'path';
import semver from 'semver';
Expand Down Expand Up @@ -69,7 +69,7 @@ export async function run() {
const installedVersion = await dotnetInstaller.installDotnet();
installedDotnetVersions.push(installedVersion);
}
DotnetCoreInstaller.addToPath();
DotnetInstallDir.addToPath();
}

const sourceUrl: string = core.getInput('source-url');
Expand Down

0 comments on commit 89b480a

Please sign in to comment.