mirror of
https://github.com/actions/setup-dotnet.git
synced 2025-08-20 15:40:20 +00:00
Run prettier over files
This commit is contained in:
parent
4cc87c6ba3
commit
cf245a75d4
@ -27,15 +27,16 @@ describe('version tests', () => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
each([['3.1.x', '3.1'], ['1.1.*', '1.1'], ['2.0', '2.0']]).test(
|
each([
|
||||||
"Generic version '%s' should be '%s'",
|
['3.1.x', '3.1'],
|
||||||
(vers, resVers) => {
|
['1.1.*', '1.1'],
|
||||||
let versInfo = new installer.DotNetVersionInfo(vers);
|
['2.0', '2.0']
|
||||||
|
]).test("Generic version '%s' should be '%s'", (vers, resVers) => {
|
||||||
|
let versInfo = new installer.DotNetVersionInfo(vers);
|
||||||
|
|
||||||
expect(versInfo.isExactVersion()).toBe(false);
|
expect(versInfo.isExactVersion()).toBe(false);
|
||||||
expect(versInfo.version()).toBe(resVers);
|
expect(versInfo.version()).toBe(resVers);
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
each([
|
each([
|
||||||
'',
|
'',
|
||||||
|
6
dist/index.js
vendored
6
dist/index.js
vendored
@ -17816,9 +17816,11 @@ class SxSDotnetCoreInstaller {
|
|||||||
console.log(`Setting up .NET SDK from ${toolPath}...`);
|
console.log(`Setting up .NET SDK from ${toolPath}...`);
|
||||||
let entries = fs_2.readdirSync(toolPath);
|
let entries = fs_2.readdirSync(toolPath);
|
||||||
for (var entry of entries) {
|
for (var entry of entries) {
|
||||||
yield io.cp(path.join(toolPath, entry), dest, { recursive: true, force: true });
|
yield io.cp(path.join(toolPath, entry), dest, {
|
||||||
|
recursive: true,
|
||||||
|
force: true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
;
|
|
||||||
}
|
}
|
||||||
// cache SxS directory as a tool
|
// cache SxS directory as a tool
|
||||||
let cachedDir = yield tc.cacheDir(dest, this.cachedToolName, 'sxs', this.arch);
|
let cachedDir = yield tc.cacheDir(dest, this.cachedToolName, 'sxs', this.arch);
|
||||||
|
6
package-lock.json
generated
6
package-lock.json
generated
@ -3688,9 +3688,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"prettier": {
|
"prettier": {
|
||||||
"version": "1.18.2",
|
"version": "1.19.1",
|
||||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz",
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz",
|
||||||
"integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==",
|
"integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"pretty-format": {
|
"pretty-format": {
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
"@zeit/ncc": "^0.21.0",
|
"@zeit/ncc": "^0.21.0",
|
||||||
"jest": "^26.0.1",
|
"jest": "^26.0.1",
|
||||||
"jest-circus": "^26.0.1",
|
"jest-circus": "^26.0.1",
|
||||||
"prettier": "^1.17.1",
|
"prettier": "^1.19.1",
|
||||||
"ts-jest": "^26.0.0",
|
"ts-jest": "^26.0.0",
|
||||||
"typescript": "^3.9.2",
|
"typescript": "^3.9.2",
|
||||||
"wget-improved": "^3.0.2"
|
"wget-improved": "^3.0.2"
|
||||||
|
@ -10,7 +10,7 @@ import {readdirSync} from 'fs';
|
|||||||
import * as os from 'os';
|
import * as os from 'os';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as semver from 'semver';
|
import * as semver from 'semver';
|
||||||
import uuidV4 from 'uuid/v4'
|
import uuidV4 from 'uuid/v4';
|
||||||
|
|
||||||
const IS_WINDOWS = process.platform === 'win32';
|
const IS_WINDOWS = process.platform === 'win32';
|
||||||
|
|
||||||
@ -510,17 +510,20 @@ export class SxSDotnetCoreInstaller {
|
|||||||
// create a temp dir
|
// create a temp dir
|
||||||
const tempDirectory = process.env['RUNNER_TEMP'] || '';
|
const tempDirectory = process.env['RUNNER_TEMP'] || '';
|
||||||
const dest = path.join(tempDirectory, uuidV4());
|
const dest = path.join(tempDirectory, uuidV4());
|
||||||
await io.mkdirP(dest)
|
await io.mkdirP(dest);
|
||||||
|
|
||||||
console.log(`Setting up SxS .NET SDK installation in ${dest}...`);
|
console.log(`Setting up SxS .NET SDK installation in ${dest}...`);
|
||||||
|
|
||||||
// copy all the SDK versions into a temporary SxS directory
|
// copy all the SDK versions into a temporary SxS directory
|
||||||
for(var toolPath of this.toolPaths) {
|
for (var toolPath of this.toolPaths) {
|
||||||
console.log(`Setting up .NET SDK from ${toolPath}...`);
|
console.log(`Setting up .NET SDK from ${toolPath}...`);
|
||||||
let entries = readdirSync(toolPath);
|
let entries = readdirSync(toolPath);
|
||||||
for (var entry of entries) {
|
for (var entry of entries) {
|
||||||
await io.cp(path.join(toolPath, entry), dest, { recursive: true, force: true });
|
await io.cp(path.join(toolPath, entry), dest, {
|
||||||
};
|
recursive: true,
|
||||||
|
force: true
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// cache SxS directory as a tool
|
// cache SxS directory as a tool
|
||||||
@ -531,7 +534,7 @@ export class SxSDotnetCoreInstaller {
|
|||||||
this.arch
|
this.arch
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log(`SxS .NET SDK installation in ${cachedDir}`)
|
console.log(`SxS .NET SDK installation in ${cachedDir}`);
|
||||||
|
|
||||||
// Need to set this so that .NET Core global tools find the right locations.
|
// Need to set this so that .NET Core global tools find the right locations.
|
||||||
core.exportVariable('DOTNET_ROOT', cachedDir);
|
core.exportVariable('DOTNET_ROOT', cachedDir);
|
||||||
|
@ -34,12 +34,14 @@ export async function run() {
|
|||||||
let versions = version.split(',');
|
let versions = version.split(',');
|
||||||
console.log(`Specified .NET verions: ${versions}`);
|
console.log(`Specified .NET verions: ${versions}`);
|
||||||
for (var currentVersion of versions) {
|
for (var currentVersion of versions) {
|
||||||
console.log(`Installing .NET SDK ${currentVersion}...`)
|
console.log(`Installing .NET SDK ${currentVersion}...`);
|
||||||
const dotnetInstaller = new installer.DotnetCoreInstaller(currentVersion);
|
const dotnetInstaller = new installer.DotnetCoreInstaller(
|
||||||
|
currentVersion
|
||||||
|
);
|
||||||
toolPaths.push(await dotnetInstaller.installDotnet());
|
toolPaths.push(await dotnetInstaller.installDotnet());
|
||||||
}
|
}
|
||||||
if (toolPaths.length > 0) {
|
if (toolPaths.length > 0) {
|
||||||
console.log(`Setting up SxS .NET SDK versions...`)
|
console.log(`Setting up SxS .NET SDK versions...`);
|
||||||
const sxsInstall = new installer.SxSDotnetCoreInstaller(toolPaths);
|
const sxsInstall = new installer.SxSDotnetCoreInstaller(toolPaths);
|
||||||
await sxsInstall.setupSxs();
|
await sxsInstall.setupSxs();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user