aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/plugin/install.ts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/plugin/install.ts')
-rwxr-xr-xscripts/plugin/install.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/plugin/install.ts b/scripts/plugin/install.ts
index 54738f50f..2ea8a658b 100755
--- a/scripts/plugin/install.ts
+++ b/scripts/plugin/install.ts
@@ -12,12 +12,14 @@ program
12 .option('-p, --plugin-path [pluginPath]', 'Path of the plugin you want to install') 12 .option('-p, --plugin-path [pluginPath]', 'Path of the plugin you want to install')
13 .parse(process.argv) 13 .parse(process.argv)
14 14
15if (!program['npmName'] && !program['pluginPath']) { 15const options = program.opts()
16
17if (!options.npmName && !options.pluginPath) {
16 console.error('You need to specify a plugin name with the desired version, or a plugin path.') 18 console.error('You need to specify a plugin name with the desired version, or a plugin path.')
17 process.exit(-1) 19 process.exit(-1)
18} 20}
19 21
20if (program['pluginPath'] && !isAbsolute(program['pluginPath'])) { 22if (options.pluginPath && !isAbsolute(options.pluginPath)) {
21 console.error('Plugin path should be absolute.') 23 console.error('Plugin path should be absolute.')
22 process.exit(-1) 24 process.exit(-1)
23} 25}
@@ -32,6 +34,6 @@ run()
32async function run () { 34async function run () {
33 await initDatabaseModels(true) 35 await initDatabaseModels(true)
34 36
35 const toInstall = program['npmName'] || program['pluginPath'] 37 const toInstall = options.npmName || options.pluginPath
36 await PluginManager.Instance.install(toInstall, program['pluginVersion'], !!program['pluginPath']) 38 await PluginManager.Instance.install(toInstall, options.pluginVersion, !!options.pluginPath)
37} 39}