aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/plugin/install.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-02-03 09:33:05 +0100
committerChocobozzz <me@florianbigard.com>2021-02-03 09:45:08 +0100
commitba5a8d89bbf049e4afc41543bcc072cccdb02669 (patch)
tree6cc6b2dca17745cc0824c7ad4515f3bc4883fa4a /scripts/plugin/install.ts
parent29f148a61381727a432c22a71c7a2b7cc23d9c9e (diff)
downloadPeerTube-ba5a8d89bbf049e4afc41543bcc072cccdb02669.tar.gz
PeerTube-ba5a8d89bbf049e4afc41543bcc072cccdb02669.tar.zst
PeerTube-ba5a8d89bbf049e4afc41543bcc072cccdb02669.zip
Update server dependencies
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}