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