diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ec16a5..face090 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Zlux App Server Changelog All notable changes to the Zlux App Server package will be documented in this file. + +## v2.12.0 +- enhancement: new versions of components can change the location of their plugins, as the app-server will now re-inspect the plugin locations on each startup. (#280) + ## v2.11.0 diff --git a/bin/init/plugins-init.js b/bin/init/plugins-init.js index 15e5e58..d99e7de 100644 --- a/bin/init/plugins-init.js +++ b/bin/init/plugins-init.js @@ -38,33 +38,27 @@ function deleteFile(path) { } function registerPlugin(pluginPath, pluginDefinition) { - const pointerPath = `${pluginPointerDirectory}/${pluginDefinition.identifier}.json`; - if (fs.fileExists(pointerPath)) { - //in case of upgrade - registerApp2App(pluginPath, pluginDefinition.identifier, pluginDefinition.pluginVersion); - return true; - } else { - let location, relativeTo; - if (pluginPath.startsWith(runtimeDirectory)) { - relativeTo = "$ZWE_zowe_runtimeDirectory"; - location = pluginPath.substring(runtimeDirectory.length); - if (location.startsWith('/')) { - location = location.substring(1); - } - - xplatform.storeFileUTF8(pointerPath, xplatform.AUTO_DETECT, JSON.stringify({ - "identifier": pluginDefinition.identifier, - "pluginLocation": location, - "relativeTo": relativeTo - }, null, 2)); - } else { - xplatform.storeFileUTF8(pointerPath, xplatform.AUTO_DETECT, JSON.stringify({ - "identifier": pluginDefinition.identifier, - "pluginLocation": pluginPath - }, null, 2)); + const pointerPath = `${pluginPointerDirectory}/${pluginDefinition.identifier}.json`; + let location, relativeTo; + if (pluginPath.startsWith(runtimeDirectory)) { + relativeTo = "$ZWE_zowe_runtimeDirectory"; + location = pluginPath.substring(runtimeDirectory.length); + if (location.startsWith('/')) { + location = location.substring(1); } - registerApp2App(pluginPath, pluginDefinition.identifier, pluginDefinition.pluginVersion); + + xplatform.storeFileUTF8(pointerPath, xplatform.AUTO_DETECT, JSON.stringify({ + "identifier": pluginDefinition.identifier, + "pluginLocation": location, + "relativeTo": relativeTo + }, null, 2)); + } else { + xplatform.storeFileUTF8(pointerPath, xplatform.AUTO_DETECT, JSON.stringify({ + "identifier": pluginDefinition.identifier, + "pluginLocation": pluginPath + }, null, 2)); } + registerApp2App(pluginPath, pluginDefinition.identifier, pluginDefinition.pluginVersion); }