diff options
author | Chocobozzz <me@florianbigard.com> | 2021-02-03 09:33:05 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-02-03 09:45:08 +0100 |
commit | ba5a8d89bbf049e4afc41543bcc072cccdb02669 (patch) | |
tree | 6cc6b2dca17745cc0824c7ad4515f3bc4883fa4a /scripts/plugin/install.ts | |
parent | 29f148a61381727a432c22a71c7a2b7cc23d9c9e (diff) | |
download | PeerTube-ba5a8d89bbf049e4afc41543bcc072cccdb02669.tar.gz PeerTube-ba5a8d89bbf049e4afc41543bcc072cccdb02669.tar.zst PeerTube-ba5a8d89bbf049e4afc41543bcc072cccdb02669.zip |
Update server dependencies
Diffstat (limited to 'scripts/plugin/install.ts')
-rwxr-xr-x | scripts/plugin/install.ts | 10 |
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 | ||
15 | if (!program['npmName'] && !program['pluginPath']) { | 15 | const options = program.opts() |
16 | |||
17 | if (!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 | ||
20 | if (program['pluginPath'] && !isAbsolute(program['pluginPath'])) { | 22 | if (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() | |||
32 | async function run () { | 34 | async 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 | } |