Skip to content

Commit

Permalink
Fix lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mattheusv committed Jul 3, 2020
1 parent cd99b86 commit 57f98a6
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 15 deletions.
1 change: 0 additions & 1 deletion __tests__/installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ describe('installer', () => {
const insider = await installer.getInsider('2.0.4')
expect(fs.existsSync(insider)).toBe(true)
}, 100000)

})
10 changes: 5 additions & 5 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4786,7 +4786,7 @@ function getInsider(version) {
const downloadPath = yield tc.downloadTool(downloadURL);
core.info('📦 Extracting Insider...');
let extPath;
if (osPlat == 'win32') {
if (osPlat === 'win32') {
extPath = yield tc.extractZip(downloadPath);
}
else {
Expand All @@ -4795,7 +4795,7 @@ function getInsider(version) {
core.debug(`Extracted to ${extPath}`);
const cachePath = yield tc.cacheDir(extPath, 'insider-action', release.tag_name);
core.debug(`Cached to ${cachePath}`);
const exePath = path.join(cachePath, osPlat == 'win32' ? 'insider.exe' : 'insider');
const exePath = path.join(cachePath, osPlat === 'win32' ? 'insider.exe' : 'insider');
core.debug(`Exe path is ${exePath}`);
return exePath;
});
Expand All @@ -4807,9 +4807,9 @@ const getRelease = (version) => __awaiter(void 0, void 0, void 0, function* () {
return (yield http.getJson(url)).result;
});
const getFileName = (version) => {
const platform = osPlat == 'win32' ? 'windows' : osPlat == 'darwin' ? 'darwin' : 'linux';
const arch = osArch == 'x64' ? 'x86_64' : 'i386';
const ext = osPlat == 'win32' ? 'zip' : 'tar.gz';
const platform = osPlat === 'win32' ? 'windows' : osPlat === 'darwin' ? 'darwin' : 'linux';
const arch = osArch === 'x64' ? 'x86_64' : 'i386';
const ext = osPlat === 'win32' ? 'zip' : 'tar.gz';
return `insider_${version}_${platform}_${arch}.${ext}`;
};

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"@actions/core": "^1.2.0",
"@actions/exec": "^1.0.4",
"@actions/http-client": "^1.0.8",
"@actions/tool-cache": "^1.5.5"
"@actions/tool-cache": "^1.5.5",
"eslint-plugin-prettier": "^3.1.4"
},
"devDependencies": {
"@types/jest": "^24.0.23",
Expand Down
11 changes: 6 additions & 5 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export async function getInsider(version: string): Promise<string> {

core.info('📦 Extracting Insider...')
let extPath: string
if (osPlat == 'win32') {
if (osPlat === 'win32') {
extPath = await tc.extractZip(downloadPath)
} else {
extPath = await tc.extractTar(downloadPath)
Expand All @@ -37,7 +37,7 @@ export async function getInsider(version: string): Promise<string> {

const exePath: string = path.join(
cachePath,
osPlat == 'win32' ? 'insider.exe' : 'insider'
osPlat === 'win32' ? 'insider.exe' : 'insider'
)
core.debug(`Exe path is ${exePath}`)

Expand All @@ -56,8 +56,9 @@ const getRelease = async (version: string): Promise<GitHubRelease | null> => {
}

const getFileName = (version: string): string => {
const platform = osPlat == 'win32' ? 'windows' : osPlat == 'darwin' ? 'darwin' : 'linux'
const arch = osArch == 'x64' ? 'x86_64' : 'i386'
const ext = osPlat == 'win32' ? 'zip' : 'tar.gz'
const platform =
osPlat === 'win32' ? 'windows' : osPlat === 'darwin' ? 'darwin' : 'linux'
const arch = osArch === 'x64' ? 'x86_64' : 'i386'
const ext = osPlat === 'win32' ? 'zip' : 'tar.gz'
return `insider_${version}_${platform}_${arch}.${ext}`
}
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { run } from './run'
import {run} from './run'

run()
2 changes: 1 addition & 1 deletion src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export async function run(): Promise<void> {
}
}

function getArguments(): Array<string> {
function getArguments(): string[] {
const technology = core.getInput('technology')
const target = core.getInput('target') || '.'
const security = core.getInput('security')
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1660,7 +1660,7 @@ eslint-plugin-jsx-a11y@>=6.0.0:
jsx-ast-utils "^2.4.1"
language-tags "^1.0.5"

eslint-plugin-prettier@>=2.6.0:
eslint-plugin-prettier@>=2.6.0, eslint-plugin-prettier@^3.1.4:
version "3.1.4"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.4.tgz#168ab43154e2ea57db992a2cd097c828171f75c2"
integrity sha512-jZDa8z76klRqo+TdGDTFJSavwbnWK2ZpqGKNZ+VvweMW516pDUMmQ2koXvxEE4JhzNvTv+radye/bWGBmA6jmg==
Expand Down

0 comments on commit 57f98a6

Please sign in to comment.