Skip to content

Commit

Permalink
fix: fix plugin installation script #589
Browse files Browse the repository at this point in the history
  • Loading branch information
duttarnab committed Nov 4, 2022
1 parent 487cd9c commit 4da2e07
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
6 changes: 3 additions & 3 deletions admin-ui/build/cli-tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ program
.option('-c, --clear [serve/dist]')
.option('-cr, --create [serve/dist]')
.parse(process.argv);

const options = program.opts();
for (const commandName in commands) {
if (commands.hasOwnProperty(commandName) && program[commandName]) {
commands[commandName](program[commandName]);
if (commands.hasOwnProperty(commandName) && options[commandName]) {
commands[commandName](options[commandName]);
}
}
11 changes: 6 additions & 5 deletions admin-ui/build/plugin-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ const commands = {
removePlugin: function(pluginName) {
try {
const pluginsPath = dirParamToPath('plugins')
const pluginPathInRepo = path.join(pluginsPath, pluginName)

const pluginDirName = path.dirname(pluginsObj.filter(ele => ele.key === pluginName)[0].metadataFile).replace('./', '')
const pluginPathInRepo = path.join(pluginsPath, pluginDirName)

if (fse.existsSync(pluginPathInRepo)) {
rimraf.sync(pluginPathInRepo)
fse.writeFileSync(
Expand Down Expand Up @@ -116,10 +117,10 @@ program
.option('-ap, --addPlugin []')
.option('-rp, --removePlugin []')
.parse(process.argv)

const options = program.opts();
for (const commandName in commands) {
// eslint-disable-next-line no-prototype-builtins
if (commands.hasOwnProperty(commandName) && program[commandName]) {
commands[commandName](program[commandName])
if (commands.hasOwnProperty(commandName) && options[commandName]) {
commands[commandName](options[commandName])
}
}
2 changes: 2 additions & 0 deletions flex-linux-setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ To add/remove Admin UI, on vm execute -

2. Execute
`python3 /opt/jans/jans-setup/static/scripts/admin_ui_plugin.py`

The available plugins can be downloaded from https://jenkins.gluu.org/npm/admin_ui/<git-branch-name>

0 comments on commit 4da2e07

Please sign in to comment.