mirror of
https://github.com/actions/setup-dotnet.git
synced 2025-08-18 14:45:09 +00:00
Format ts
This commit is contained in:
parent
07ddfd314e
commit
5668f1310e
@ -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"
|
||||
|
@ -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,
|
||||
{
|
||||
resultCode = await exec.exec(`"${scriptPath}"`, scriptArguments, {
|
||||
listeners: {
|
||||
stdout: (data: Buffer) => {
|
||||
output += data.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
if (resultCode != 0) {
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user