mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Record runtime-installed modules in .config.modules.json
This commit is contained in:
parent
395b499856
commit
ddb715d88d
@ -125,8 +125,6 @@ function importModule(module) {
|
||||
return import(moduleFile);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function parseModuleName(module) {
|
||||
var match = /((?:@[^/]+\/)?[^/@]+)(?:@([\s\S]+))?/.exec(module);
|
||||
if (match) {
|
||||
@ -254,6 +252,9 @@ async function installModule(moduleDetails) {
|
||||
return hooks.trigger("postInstall", triggerPayload)
|
||||
}).then(() => {
|
||||
log.info(log._("server.install.installed", { name: installSpec }));
|
||||
const runtimeInstalledModules = settings.get("modules") || {};
|
||||
runtimeInstalledModules[moduleDetails.module] = moduleDetails;
|
||||
settings.set("modules",runtimeInstalledModules)
|
||||
}).catch(result => {
|
||||
var output = result.stderr || result.toString();
|
||||
var e;
|
||||
@ -275,10 +276,10 @@ async function installModule(moduleDetails) {
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
init: init,
|
||||
register: register,
|
||||
registerSubflow: registerSubflow,
|
||||
checkFlowDependencies: checkFlowDependencies,
|
||||
init,
|
||||
register,
|
||||
registerSubflow,
|
||||
checkFlowDependencies,
|
||||
require: requireModule,
|
||||
import: importModule
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ const fspath = require("path");
|
||||
const log = require("@node-red/util").log;
|
||||
const util = require("./util");
|
||||
|
||||
const configSections = ['nodes','users','projects'];
|
||||
const configSections = ['nodes','users','projects','modules'];
|
||||
|
||||
const settingsCache = {};
|
||||
|
||||
@ -59,6 +59,7 @@ async function migrateToMultipleConfigFiles() {
|
||||
* - .config.nodes.json - the node registry
|
||||
* - .config.users.json - user specific settings (eg editor settings)
|
||||
* - .config.projects.json - project settings, including the active project
|
||||
* - .config.modules.json - external modules installed by the runtime
|
||||
* - .config.runtime.json - everything else - most notable _credentialSecret
|
||||
*/
|
||||
function writeSettings(data) {
|
||||
|
Loading…
Reference in New Issue
Block a user