]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - scripts/plugin/uninstall.ts
feat(server): add redis sentinel support (#5593)
[github/Chocobozzz/PeerTube.git] / scripts / plugin / uninstall.ts
index b5e1ddea296d1e2944c0baa39a66ae0161ef095e..7705946856a20de6d817d8d8b6987fd654e943be 100755 (executable)
@@ -1,12 +1,14 @@
+import { program } from 'commander'
 import { initDatabaseModels } from '../../server/initializers/database'
-import * as program from 'commander'
 import { PluginManager } from '../../server/lib/plugins/plugin-manager'
 
 program
   .option('-n, --npm-name [npmName]', 'Package name to install')
   .parse(process.argv)
 
-if (!program['npmName']) {
+const options = program.opts()
+
+if (!options.npmName) {
   console.error('You need to specify the plugin name.')
   process.exit(-1)
 }
@@ -19,8 +21,9 @@ run()
   })
 
 async function run () {
+
   await initDatabaseModels(true)
 
-  const toUninstall = program['npmName']
-  await PluginManager.Instance.uninstall(toUninstall)
+  const toUninstall = options.npmName
+  await PluginManager.Instance.uninstall({ npmName: toUninstall, unregister: false })
 }