Skip to content

Commit

Permalink
🔧 Linting, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
felixrieseberg committed Sep 4, 2018
1 parent 5ddbd2c commit 62772e4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
25 changes: 22 additions & 3 deletions src/aquire-installers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import chalk from 'chalk';

import { OFFLINE_PATH } from './constants';
import { download } from './download';
import { log } from './logging';
import { copyInstallers } from './offline';


/**
* Aquire the installers, either by copying them from
* their offline location or by downloading them.
Expand All @@ -10,11 +14,26 @@ import { copyInstallers } from './offline';
* @returns {Promise.void}
*/
export async function aquireInstallers(cb: () => void): Promise<void> {
const handleFailure = (error: Error) => {
log(chalk.bold.red(`Downloading installers failed. Error:`), error);
log(chalk.bold.red(`windows-build-tools will now exit.`));

process.exit(1);
};

if (OFFLINE_PATH) {
await copyInstallers();
try {
await copyInstallers();

cb();
cb();
} catch (error) {
handleFailure(error);
}
} else {
download(cb);
try {
await download(cb);
} catch (error) {
handleFailure(error);
}
}
}
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"outDir": "dist",
"baseUrl": ".",
"paths": {
"*" : ["./node_modules/@types/*", "*"]
Expand Down
4 changes: 1 addition & 3 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@
"single",
"avoid-escape"
],
"max-classes-per-file": [
false
],
"max-classes-per-file": false,
"semicolon": [
true,
"always"
Expand Down

0 comments on commit 62772e4

Please sign in to comment.