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