aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/plugin/uninstall.ts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/plugin/uninstall.ts')
-rwxr-xr-xscripts/plugin/uninstall.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/plugin/uninstall.ts b/scripts/plugin/uninstall.ts
new file mode 100755
index 000000000..b5e1ddea2
--- /dev/null
+++ b/scripts/plugin/uninstall.ts
@@ -0,0 +1,26 @@
1import { initDatabaseModels } from '../../server/initializers/database'
2import * as program from 'commander'
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
9if (!program['npmName']) {
10 console.error('You need to specify the plugin name.')
11 process.exit(-1)
12}
13
14run()
15 .then(() => process.exit(0))
16 .catch(err => {
17 console.error(err)
18 process.exit(-1)
19 })
20
21async function run () {
22 await initDatabaseModels(true)
23
24 const toUninstall = program['npmName']
25 await PluginManager.Instance.uninstall(toUninstall)
26}