Run prettier over files

This commit is contained in:
Patrick Dwyer 2020-06-29 09:28:53 +10:00
parent 4cc87c6ba3
commit cf245a75d4
No known key found for this signature in database
GPG Key ID: C3079F8B8CAEEC7A
8 changed files with 1018 additions and 1010 deletions

View File

@ -27,15 +27,16 @@ describe('version tests', () => {
}
);
each([['3.1.x', '3.1'], ['1.1.*', '1.1'], ['2.0', '2.0']]).test(
"Generic version '%s' should be '%s'",
(vers, resVers) => {
each([
['3.1.x', '3.1'],
['1.1.*', '1.1'],
['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.version()).toBe(resVers);
}
);
});
each([
'',

6
dist/index.js vendored
View File

@ -17816,9 +17816,11 @@ class SxSDotnetCoreInstaller {
console.log(`Setting up .NET SDK from ${toolPath}...`);
let entries = fs_2.readdirSync(toolPath);
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
let cachedDir = yield tc.cacheDir(dest, this.cachedToolName, 'sxs', this.arch);

6
package-lock.json generated
View File

@ -3688,9 +3688,9 @@
"dev": true
},
"prettier": {
"version": "1.18.2",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz",
"integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==",
"version": "1.19.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz",
"integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==",
"dev": true
},
"pretty-format": {

View File

@ -40,7 +40,7 @@
"@zeit/ncc": "^0.21.0",
"jest": "^26.0.1",
"jest-circus": "^26.0.1",
"prettier": "^1.17.1",
"prettier": "^1.19.1",
"ts-jest": "^26.0.0",
"typescript": "^3.9.2",
"wget-improved": "^3.0.2"

View File

@ -10,7 +10,7 @@ import {readdirSync} from 'fs';
import * as os from 'os';
import * as path from 'path';
import * as semver from 'semver';
import uuidV4 from 'uuid/v4'
import uuidV4 from 'uuid/v4';
const IS_WINDOWS = process.platform === 'win32';
@ -510,17 +510,20 @@ export class SxSDotnetCoreInstaller {
// create a temp dir
const tempDirectory = process.env['RUNNER_TEMP'] || '';
const dest = path.join(tempDirectory, uuidV4());
await io.mkdirP(dest)
await io.mkdirP(dest);
console.log(`Setting up SxS .NET SDK installation in ${dest}...`);
// 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}...`);
let entries = readdirSync(toolPath);
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
@ -531,7 +534,7 @@ export class SxSDotnetCoreInstaller {
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.
core.exportVariable('DOTNET_ROOT', cachedDir);

View File

@ -34,12 +34,14 @@ export async function run() {
let versions = version.split(',');
console.log(`Specified .NET verions: ${versions}`);
for (var currentVersion of versions) {
console.log(`Installing .NET SDK ${currentVersion}...`)
const dotnetInstaller = new installer.DotnetCoreInstaller(currentVersion);
console.log(`Installing .NET SDK ${currentVersion}...`);
const dotnetInstaller = new installer.DotnetCoreInstaller(
currentVersion
);
toolPaths.push(await dotnetInstaller.installDotnet());
}
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);
await sxsInstall.setupSxs();
}