diff --git a/package.json b/package.json index dd06a71..26a9c36 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "description": "setup dotnet action", "main": "lib/setup-dotnet.js", "scripts": { - "build": "tsc", + "build": "npm install && tsc", "format": "prettier --write **/*.ts", "format-check": "prettier --check **/*.ts", "test": "jest" diff --git a/src/installer.ts b/src/installer.ts index 8ffba22..a5312af 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -9,7 +9,7 @@ import * as semver from 'semver'; const IS_WINDOWS = process.platform === 'win32'; export class DotnetCoreInstaller { - constructor(version: string = "", jsonfile: string = "") { + constructor(version: string = '', jsonfile: string = '') { if (semver.valid(semver.clean(version) || '') == null) { throw 'Implicit version not permitted'; } @@ -70,17 +70,13 @@ export class DotnetCoreInstaller { scriptArguments.concat(['--jsonfile', this.jsonfile]); } - resultCode = await exec.exec( - `"${scriptPath}"`, - scriptArguments, - { - listeners: { - stdout: (data: Buffer) => { - output += data.toString(); - } + resultCode = await exec.exec(`"${scriptPath}"`, scriptArguments, { + listeners: { + stdout: (data: Buffer) => { + output += data.toString(); } } - ); + }); } if (resultCode != 0) { diff --git a/src/setup-dotnet.ts b/src/setup-dotnet.ts index ffb5acf..08ab9c1 100644 --- a/src/setup-dotnet.ts +++ b/src/setup-dotnet.ts @@ -23,7 +23,10 @@ async function run() { core.debug('No version found, falling back to global.json'); const globalJsonPath = path.join(process.cwd(), 'global.json'); if (fs.existsSync(globalJsonPath)) { - const dotnetInstaller = new installer.DotnetCoreInstaller(undefined, globalJsonPath); + const dotnetInstaller = new installer.DotnetCoreInstaller( + undefined, + globalJsonPath + ); await dotnetInstaller.installDotnet(); } }