]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - scripts/plugin/uninstall.ts
Error if importing a torrent with multiple files
[github/Chocobozzz/PeerTube.git] / scripts / plugin / uninstall.ts
index b5e1ddea296d1e2944c0baa39a66ae0161ef095e..8710b175095ca06df5c290495efd1784c91915a8 100755 (executable)
@@ -1,3 +1,6 @@
+import { registerTSPaths } from '../../server/helpers/register-ts-paths'
+registerTSPaths()
+
 import { initDatabaseModels } from '../../server/initializers/database'
 import * as program from 'commander'
 import { PluginManager } from '../../server/lib/plugins/plugin-manager'
@@ -6,7 +9,9 @@ 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 +24,9 @@ run()
   })
 
 async function run () {
+
   await initDatabaseModels(true)
 
-  const toUninstall = program['npmName']
+  const toUninstall = options.npmName
   await PluginManager.Instance.uninstall(toUninstall)
 }