]>
Commit | Line | Data |
---|---|---|
2aaa1a3f C |
1 | import { registerTSPaths } from '../../server/helpers/register-ts-paths' |
2 | registerTSPaths() | |
3 | ||
b5f919ac C |
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 () { | |
2aaa1a3f | 25 | |
b5f919ac C |
26 | await initDatabaseModels(true) |
27 | ||
28 | const toUninstall = program['npmName'] | |
29 | await PluginManager.Instance.uninstall(toUninstall) | |
30 | } |