Misc formatting changes

This commit is contained in:
hensm
2019-04-09 01:01:23 +01:00
parent d98397da42
commit a6ebb4fd22
2 changed files with 15 additions and 10 deletions

View File

@@ -20,10 +20,10 @@ const argv = minimist(process.argv.slice(2), {
boolean: [ "package", "watch" ] boolean: [ "package", "watch" ]
, string: [ "mirroringAppId", "mode" ] , string: [ "mirroringAppId", "mode" ]
, default: { , default: {
package: false // Should package with web-ext package: false // Should package with web-ext
, watch: false // Should run webpack in watch mode , watch: false // Should run webpack in watch mode
, mirroringAppId: extPackageMeta.__mirroringAppId // Chromecast receiver app ID , mirroringAppId: extPackageMeta.__mirroringAppId // Chromecast receiver app ID
, mode: "development" // webpack mode , mode: "development" // webpack mode
} }
}); });
@@ -101,14 +101,15 @@ if (argv.watch) {
shouldExitProgram: false shouldExitProgram: false
}).then(result => { }).then(result => {
const archiveName = path.basename(result.extensionPath); const outputName = path.basename(result.extensionPath);
fs.moveSync(path.join(DIST_PATH, archiveName) // Rename output extension to XPI
, path.join(DIST_PATH, archiveName.replace("zip", "xpi"))); fs.moveSync(path.join(DIST_PATH, outputName)
, path.join(DIST_PATH, outputName.replace("zip", "xpi")));
// Only need the built extension archive // Only need the built extension archive
fs.remove(UNPACKED_PATH); fs.remove(UNPACKED_PATH);
}) });
} }
}); });
} }
@@ -131,8 +132,12 @@ function handleCompilerOutput (err, stats) {
const info = stats.toJson(); const info = stats.toJson();
// Log errors/warnings // Log errors/warnings
if (stats.hasErrors()) console.error(info.errors); if (stats.hasErrors()) {
if (stats.hasWarnings()) console.warn(info.warnings); console.error(info.errors);
}
if (stats.hasWarnings()) {
console.warn(info.warnings);
}
// Log formatted output // Log formatted output
console.log(stats.toString()); console.log(stats.toString());

View File

@@ -7,7 +7,7 @@ const { ROOT, INCLUDE_PATH } = require("./lib/paths");
spawnSync(`tslint --config ${ROOT}/tslint.json \ spawnSync(`tslint --config ${ROOT}/tslint.json \
--project ${ROOT}/tsconfig.json \ --project ${ROOT}/tsconfig.json \
"${INCLUDE_PATH}/**/*.ts{,x}"` "${INCLUDE_PATH}/**/*.ts{,x}"`
, { , {
shell: true shell: true
, stdio: [ process.stdin, process.stdout, process.stderr ] , stdio: [ process.stdin, process.stdout, process.stderr ]
}); });