aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/plugin/uninstall.ts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/plugin/uninstall.ts')
-rwxr-xr-xscripts/plugin/uninstall.ts27
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/plugin/uninstall.ts b/scripts/plugin/uninstall.ts
new file mode 100755
index 000000000..7dcc234db
--- /dev/null
+++ b/scripts/plugin/uninstall.ts
@@ -0,0 +1,27 @@
1import { initDatabaseModels } from '../../server/initializers/database'
2import * as program from 'commander'
3import { PluginManager } from '../../server/lib/plugins/plugin-manager'
4import { isAbsolute } from 'path'
5
6program
7 .option('-n, --package-name [packageName]', 'Package name to install')
8 .parse(process.argv)
9
10if (!program['packageName']) {
11 console.error('You need to specify the plugin name.')
12 process.exit(-1)
13}
14
15run()
16 .then(() => process.exit(0))
17 .catch(err => {
18 console.error(err)
19 process.exit(-1)
20 })
21
22async function run () {
23 await initDatabaseModels(true)
24
25 const toUninstall = program['packageName']
26 await PluginManager.Instance.uninstall(toUninstall)
27}