Skip to content

Commit 4da2e07

Browse files
committed
fix: fix plugin installation script #589
1 parent 487cd9c commit 4da2e07

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

admin-ui/build/cli-tools.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ program
4040
.option('-c, --clear [serve/dist]')
4141
.option('-cr, --create [serve/dist]')
4242
.parse(process.argv);
43-
43+
const options = program.opts();
4444
for (const commandName in commands) {
45-
if (commands.hasOwnProperty(commandName) && program[commandName]) {
46-
commands[commandName](program[commandName]);
45+
if (commands.hasOwnProperty(commandName) && options[commandName]) {
46+
commands[commandName](options[commandName]);
4747
}
4848
}

admin-ui/build/plugin-cli.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ const commands = {
7373
removePlugin: function(pluginName) {
7474
try {
7575
const pluginsPath = dirParamToPath('plugins')
76-
const pluginPathInRepo = path.join(pluginsPath, pluginName)
77-
76+
const pluginDirName = path.dirname(pluginsObj.filter(ele => ele.key === pluginName)[0].metadataFile).replace('./', '')
77+
const pluginPathInRepo = path.join(pluginsPath, pluginDirName)
78+
7879
if (fse.existsSync(pluginPathInRepo)) {
7980
rimraf.sync(pluginPathInRepo)
8081
fse.writeFileSync(
@@ -116,10 +117,10 @@ program
116117
.option('-ap, --addPlugin []')
117118
.option('-rp, --removePlugin []')
118119
.parse(process.argv)
119-
120+
const options = program.opts();
120121
for (const commandName in commands) {
121122
// eslint-disable-next-line no-prototype-builtins
122-
if (commands.hasOwnProperty(commandName) && program[commandName]) {
123-
commands[commandName](program[commandName])
123+
if (commands.hasOwnProperty(commandName) && options[commandName]) {
124+
commands[commandName](options[commandName])
124125
}
125126
}

flex-linux-setup/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,5 @@ To add/remove Admin UI, on vm execute -
4949
5050
2. Execute
5151
`python3 /opt/jans/jans-setup/static/scripts/admin_ui_plugin.py`
52+
53+
The available plugins can be downloaded from https://jenkins.gluu.org/npm/admin_ui/<git-branch-name>

0 commit comments

Comments
 (0)