]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix CLI plugins list command: use command parameters.
authorJohn Livingston <git@john-livingston.fr>
Fri, 7 May 2021 15:32:58 +0000 (17:32 +0200)
committerChocobozzz <chocobozzz@cpy.re>
Mon, 10 May 2021 06:03:20 +0000 (08:03 +0200)
server/tools/peertube-plugins.ts

index 08e8cd713d5bf038e711d8bedd01ab1a0e3fef74..c8a5768448c2fd3f1648cb293e4a4f197455b8a9 100644 (file)
@@ -24,7 +24,7 @@ program
   .option('-p, --password <token>', 'Password')
   .option('-t, --only-themes', 'List themes only')
   .option('-P, --only-plugins', 'List plugins only')
-  .action(() => pluginsListCLI())
+  .action((options, command) => pluginsListCLI(command, options))
 
 program
   .command('install')
@@ -61,12 +61,10 @@ if (!process.argv.slice(2).length) {
 
 program.parse(process.argv)
 
-const options = program.opts()
-
 // ----------------------------------------------------------------------------
 
-async function pluginsListCLI () {
-  const { url, username, password } = await getServerCredentials(program)
+async function pluginsListCLI (command: commander.CommanderStatic, options: commander.OptionValues) {
+  const { url, username, password } = await getServerCredentials(command)
   const accessToken = await getAdminTokenOrDie(url, username, password)
 
   let pluginType: PluginType