]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - scripts/plugin/uninstall.ts
Faster ci using compiled ts files
[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
ba5a8d89
C
12const options = program.opts()
13
14if (!options.npmName) {
b5f919ac
C
15 console.error('You need to specify the plugin name.')
16 process.exit(-1)
17}
18
19run()
20 .then(() => process.exit(0))
21 .catch(err => {
22 console.error(err)
23 process.exit(-1)
24 })
25
26async function run () {
2aaa1a3f 27
b5f919ac
C
28 await initDatabaseModels(true)
29
ba5a8d89 30 const toUninstall = options.npmName
b5f919ac
C
31 await PluginManager.Instance.uninstall(toUninstall)
32}