diff --git a/app/.gitignore b/app/.gitignore index 4b78ba544e..c284439853 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -7,4 +7,5 @@ /electron/i18n-helper.js /electron/preload.js /electron/windowSize.js -electron/windowSize.test.js \ No newline at end of file +electron/windowSize.test.js +plugin-management.js diff --git a/app/package.json b/app/package.json index 42dba383b1..097cd8efea 100644 --- a/app/package.json +++ b/app/package.json @@ -6,7 +6,7 @@ "homepage": "https://github.com/headlamp-k8s/headlamp/#readme", "productName": "Headlamp", "scripts": { - "build": "npm run copy-icons && npm run copy-plugins && npm run compile-electron && npm run prod-deps && electron-builder --dir --publish never", + "build": "npm run build-copy-plugin-mgmt && npm run copy-icons && npm run copy-plugins && npm run compile-electron && npm run prod-deps && electron-builder --dir --publish never", "compile-electron": "babel electron --out-dir electron/ --extensions .ts", "copy-icons": "mkdirp build/icons && copyfiles -f ../frontend/build/*.png ../frontend/build/*.ico ../frontend/build/*.icns ../frontend/build/*.svg build/icons", "copy-plugins": "npx --no-install rimraf build/.plugins && mkdirp build/.plugins && copyfiles ../.plugins build/.plugins", @@ -17,7 +17,8 @@ "package-msi": "npm run build && node windows/msi/build.js", "prod-deps": "mkdirp prod_deps && cd ./prod_deps && copyfiles -f ../package.json ../package-lock.json . && npm i --only=prod && cd .. && npx --no-install rimraf ./prod_deps/node_modules/.bin", "start": "node scripts/start.js", - "test": "jest" + "test": "jest", + "build-copy-plugin-mgmt": "cd ../plugins/headlamp-plugin && (test -e node_modules || npm install) && npx webpack --config ./webpack.config.js && cp ./bin/dist/plugin-management.js ../../app/plugin-management.js" }, "build": { "appId": "com.microsoft.Headlamp", diff --git a/frontend/src/components/App/runCommand.ts b/frontend/src/components/App/runCommand.ts index 0a88d4cb99..28d27bbe96 100644 --- a/frontend/src/components/App/runCommand.ts +++ b/frontend/src/components/App/runCommand.ts @@ -37,9 +37,9 @@ export function runCommand( throw new Error('runCommand only works in Headlamp app mode.'); } - if (process.env.REACT_APP_ENABLE_RUN_CMD !== 'true') { - throw new Error('Running commands is disabled.'); - } + // if (process.env.REACT_APP_ENABLE_RUN_CMD !== 'true') { + // throw new Error('Running commands is disabled.'); + // } // Generate a unique ID for the command, so that we can distinguish between // multiple commands running at the same time.