]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - scripts/plugin/uninstall.ts
Fix prune storage script with some configs
[github/Chocobozzz/PeerTube.git] / scripts / plugin / uninstall.ts
1 import { initDatabaseModels } from '../../server/initializers/database'
2 import * as program from 'commander'
3 import { PluginManager } from '../../server/lib/plugins/plugin-manager'
4
5 program
6 .option('-n, --npm-name [npmName]', 'Package name to install')
7 .parse(process.argv)
8
9 if (!program['npmName']) {
10 console.error('You need to specify the plugin name.')
11 process.exit(-1)
12 }
13
14 run()
15 .then(() => process.exit(0))
16 .catch(err => {
17 console.error(err)
18 process.exit(-1)
19 })
20
21 async function run () {
22 await initDatabaseModels(true)
23
24 const toUninstall = program['npmName']
25 await PluginManager.Instance.uninstall(toUninstall)
26 }