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