From a6ebb4fd220f3408cb108fee195ed0d761118012 Mon Sep 17 00:00:00 2001 From: hensm Date: Tue, 9 Apr 2019 01:01:23 +0100 Subject: [PATCH] Misc formatting changes --- ext/bin/build.js | 23 ++++++++++++++--------- ext/bin/lint.js | 2 +- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ext/bin/build.js b/ext/bin/build.js index b35f55d..5d3a306 100644 --- a/ext/bin/build.js +++ b/ext/bin/build.js @@ -20,10 +20,10 @@ const argv = minimist(process.argv.slice(2), { boolean: [ "package", "watch" ] , string: [ "mirroringAppId", "mode" ] , default: { - package: false // Should package with web-ext - , watch: false // Should run webpack in watch mode + package: false // Should package with web-ext + , watch: false // Should run webpack in watch mode , mirroringAppId: extPackageMeta.__mirroringAppId // Chromecast receiver app ID - , mode: "development" // webpack mode + , mode: "development" // webpack mode } }); @@ -101,14 +101,15 @@ if (argv.watch) { shouldExitProgram: false }).then(result => { - const archiveName = path.basename(result.extensionPath); + const outputName = path.basename(result.extensionPath); - fs.moveSync(path.join(DIST_PATH, archiveName) - , path.join(DIST_PATH, archiveName.replace("zip", "xpi"))); + // Rename output extension to XPI + fs.moveSync(path.join(DIST_PATH, outputName) + , path.join(DIST_PATH, outputName.replace("zip", "xpi"))); // Only need the built extension archive fs.remove(UNPACKED_PATH); - }) + }); } }); } @@ -131,8 +132,12 @@ function handleCompilerOutput (err, stats) { const info = stats.toJson(); // Log errors/warnings - if (stats.hasErrors()) console.error(info.errors); - if (stats.hasWarnings()) console.warn(info.warnings); + if (stats.hasErrors()) { + console.error(info.errors); + } + if (stats.hasWarnings()) { + console.warn(info.warnings); + } // Log formatted output console.log(stats.toString()); diff --git a/ext/bin/lint.js b/ext/bin/lint.js index 037e3f5..3a0fb08 100644 --- a/ext/bin/lint.js +++ b/ext/bin/lint.js @@ -7,7 +7,7 @@ const { ROOT, INCLUDE_PATH } = require("./lib/paths"); spawnSync(`tslint --config ${ROOT}/tslint.json \ --project ${ROOT}/tsconfig.json \ "${INCLUDE_PATH}/**/*.ts{,x}"` - , { + , { shell: true , stdio: [ process.stdin, process.stdout, process.stderr ] });