mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-08 08:39:59 +00:00
Add remove-manifest script
This commit is contained in:
@@ -15,7 +15,7 @@ const CURRENT_MANIFEST_PATH = path.join(DIST_DIR_PATH, manifestName);
|
||||
const WIN_REGISTRY_KEY = "fx_cast_bridge";
|
||||
|
||||
|
||||
if (!fs.existsSync(CURRENT_MANIFEST_PATH)) {
|
||||
if (!fs.existsSync(CURRENT_MANIFEST_PATH) && !argv.remove) {
|
||||
console.error("No manifest in dist/app/ to install");
|
||||
process.exit(1);
|
||||
}
|
||||
@@ -27,6 +27,11 @@ switch (platform) {
|
||||
case "linux": {
|
||||
const destination = path.join(os.homedir(), manifestPath[platform]);
|
||||
|
||||
if (argv.remove) {
|
||||
fs.remove(path.join(destination, manifestName));
|
||||
break;
|
||||
}
|
||||
|
||||
fs.ensureDirSync(destination);
|
||||
fs.copyFileSync(CURRENT_MANIFEST_PATH
|
||||
, path.join(destination, manifestName));
|
||||
@@ -37,6 +42,11 @@ switch (platform) {
|
||||
case "win32": {
|
||||
const regedit = require("regedit");
|
||||
|
||||
if (argv.remove) {
|
||||
// TODO: no corresponding method in regedit lib
|
||||
break;
|
||||
}
|
||||
|
||||
regedit.putValue({
|
||||
"HKEY_CURRENT_USER\\SOFTWARE\\Mozilla\\NativeMessagingHosts": {
|
||||
[WIN_REGISTRY_KEY]: {
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
require('@babel/register')({
|
||||
presets: [
|
||||
[
|
||||
"@babel/preset-env"
|
||||
, {
|
||||
targets: {
|
||||
node: "current"
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
, plugins: [
|
||||
"@babel/plugin-transform-runtime"
|
||||
, "@babel/plugin-syntax-dynamic-import"
|
||||
, "@babel/plugin-syntax-import-meta"
|
||||
, "@babel/plugin-proposal-class-properties"
|
||||
, "@babel/plugin-proposal-json-strings"
|
||||
]
|
||||
});
|
||||
|
||||
require('../src/js/main');
|
||||
@@ -6,7 +6,7 @@
|
||||
"build": "node bin/build.js",
|
||||
"package": "node bin/build.js --package",
|
||||
"install-manifest": "node bin/install-manifest.js",
|
||||
"start-debug": "node bin/start-debug.js"
|
||||
"remove-manifest": "node bin/install-manifest.js --remove"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.0.0",
|
||||
|
||||
@@ -3,14 +3,19 @@
|
||||
"postinstall": "npm run postinstall:app && npm run postinstall:ext",
|
||||
"postinstall:app": "npm install ./app --prefix ./app",
|
||||
"postinstall:ext": "npm install ./ext --prefix ./ext",
|
||||
|
||||
"build": "npm run build:app && npm run build:ext",
|
||||
"build:app": "npm run build --prefix ./app",
|
||||
"build:ext": "npm run build --prefix ./ext",
|
||||
|
||||
"package": "npm run package:app && npm run package:ext",
|
||||
"package:app": "npm run package --prefix ./app",
|
||||
"package:ext": "npm run package --prefix ./ext",
|
||||
|
||||
"test": "jasmine --config=jasmine.json",
|
||||
"install-manifest": "npm run install-manifest --prefix ./app"
|
||||
|
||||
"install-manifest": "npm run install-manifest --prefix ./app",
|
||||
"remove-manifest": "npm run remove-manifest --prefix ./app"
|
||||
},
|
||||
"devDependencies": {
|
||||
"fs-extra": "^7.0.1",
|
||||
|
||||
Reference in New Issue
Block a user