Update prettier

This commit is contained in:
CrazyMax 2019-11-12 00:05:29 +01:00
parent a07e0f6915
commit 6cf8999416
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
4 changed files with 20 additions and 38 deletions

1
.github/FUNDING.yml vendored
View File

@ -1,2 +1,3 @@
github: crazy-max
patreon: crazymax
custom: https://www.paypal.me/crazyws

View File

@ -1,11 +1,11 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false,
"arrowParens": "avoid",
"parser": "typescript"
}
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false,
"arrowParens": "avoid",
"parser": "typescript"
}

View File

@ -35,23 +35,14 @@ export async function getGoReleaser(version: string): Promise<string> {
extPath = await tc.extractTar(`${tmpdir}/${fileName}`);
}
return path.join(
extPath,
osPlat == 'win32' ? 'goreleaser.exe' : 'goreleaser'
);
return path.join(extPath, osPlat == 'win32' ? 'goreleaser.exe' : 'goreleaser');
}
function getFileName(): string {
const platform: string =
osPlat == 'win32' ? 'Windows' : osPlat == 'darwin' ? 'Darwin' : 'Linux';
const platform: string = osPlat == 'win32' ? 'Windows' : osPlat == 'darwin' ? 'Darwin' : 'Linux';
const arch: string = osArch == 'x64' ? 'x86_64' : 'i386';
const ext: string = osPlat == 'win32' ? 'zip' : 'tar.gz';
const filename: string = util.format(
'goreleaser_%s_%s.%s',
platform,
arch,
ext
);
const filename: string = util.format('goreleaser_%s_%s.%s', platform, arch, ext);
return filename;
}
@ -60,24 +51,17 @@ interface GitHubRelease {
}
async function determineVersion(version: string): Promise<string> {
let rest: restm.RestClient = new restm.RestClient(
'goreleaser-action',
'https://github.com',
undefined,
{
headers: {
Accept: 'application/json'
}
let rest: restm.RestClient = new restm.RestClient('goreleaser-action', 'https://github.com', undefined, {
headers: {
Accept: 'application/json'
}
);
});
let res: restm.IRestResponse<GitHubRelease> = await rest.get<GitHubRelease>(
`/goreleaser/goreleaser/releases/${version}`
);
if (res.statusCode != 200 || res.result === null) {
throw new Error(
`Cannot find GoReleaser ${version} release (http ${res.statusCode})`
);
throw new Error(`Cannot find GoReleaser ${version} release (http ${res.statusCode})`);
}
return res.result.tag_name;

View File

@ -11,10 +11,7 @@ export async function run(silent?: boolean) {
const goreleaser = await installer.getGoReleaser(version);
let snapshot = '';
if (
!process.env.GITHUB_REF ||
!process.env.GITHUB_REF.startsWith('refs/tags/')
) {
if (!process.env.GITHUB_REF || !process.env.GITHUB_REF.startsWith('refs/tags/')) {
console.log(`⚠️ No tag found. Snapshot forced`);
if (!args.includes('--snapshot')) {
snapshot = ' --snapshot';