mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-13 02:49:58 +00:00
Add prettier and re-format .js files
This commit is contained in:
@@ -5,24 +5,20 @@ const minimist = require("minimist");
|
||||
|
||||
const paths = require("./lib/paths");
|
||||
|
||||
|
||||
const argv = minimist(process.argv.slice(2), {
|
||||
boolean: [ "remove" ]
|
||||
, default: {
|
||||
boolean: ["remove"],
|
||||
default: {
|
||||
remove: false
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
const CURRENT_MANIFEST_PATH = path.join(paths.DIST_PATH, paths.MANIFEST_NAME);
|
||||
|
||||
|
||||
if (!fs.existsSync(CURRENT_MANIFEST_PATH) && !argv.remove) {
|
||||
console.error("No manifest in dist/app/ to install.");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
||||
const platform = os.platform();
|
||||
const arch = os.arch();
|
||||
|
||||
@@ -30,9 +26,12 @@ switch (platform) {
|
||||
case "darwin":
|
||||
case "linux": {
|
||||
// Manifest location within home directory
|
||||
const destination = path.join(os.homedir(), platform === "linux"
|
||||
? ".mozilla/native-messaging-hosts/"
|
||||
: paths.getManifestPath(platform, arch));
|
||||
const destination = path.join(
|
||||
os.homedir(),
|
||||
platform === "linux"
|
||||
? ".mozilla/native-messaging-hosts/"
|
||||
: paths.getManifestPath(platform, arch)
|
||||
);
|
||||
|
||||
if (argv.remove) {
|
||||
fs.remove(path.join(destination, paths.MANIFEST_NAME));
|
||||
@@ -41,11 +40,13 @@ switch (platform) {
|
||||
|
||||
// Install manifest
|
||||
fs.ensureDirSync(destination);
|
||||
fs.copyFileSync(CURRENT_MANIFEST_PATH
|
||||
, path.join(destination, paths.MANIFEST_NAME));
|
||||
fs.copyFileSync(
|
||||
CURRENT_MANIFEST_PATH,
|
||||
path.join(destination, paths.MANIFEST_NAME)
|
||||
);
|
||||
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
case "win32": {
|
||||
const { Registry } = require("rage-edit");
|
||||
@@ -56,14 +57,10 @@ switch (platform) {
|
||||
break;
|
||||
}
|
||||
|
||||
Registry.set(
|
||||
REGISTRY_PATH
|
||||
, ""
|
||||
, CURRENT_MANIFEST_PATH
|
||||
, "REG_SZ");
|
||||
Registry.set(REGISTRY_PATH, "", CURRENT_MANIFEST_PATH, "REG_SZ");
|
||||
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
default: {
|
||||
console.error("Sorry, this installer does not yet support your OS");
|
||||
|
||||
Reference in New Issue
Block a user