]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - scripts/plugin/uninstall.ts
WIP plugins: add plugin settings/uninstall in client
[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 import { isAbsolute } from 'path'
5
6 program
7 .option('-n, --package-name [packageName]', 'Package name to install')
8 .parse(process.argv)
9
10 if (!program['packageName']) {
11 console.error('You need to specify the plugin name.')
12 process.exit(-1)
13 }
14
15 run()
16 .then(() => process.exit(0))
17 .catch(err => {
18 console.error(err)
19 process.exit(-1)
20 })
21
22 async function run () {
23 await initDatabaseModels(true)
24
25 const toUninstall = program['packageName']
26 await PluginManager.Instance.uninstall(toUninstall)
27 }