WIP plugins: static files
This commit is contained in:
parent
f023a19c3e
commit
2c0539420d
6 changed files with 124 additions and 15 deletions
27
scripts/plugin/uninstall.ts
Executable file
27
scripts/plugin/uninstall.ts
Executable file
|
@ -0,0 +1,27 @@
|
|||
import { initDatabaseModels } from '../../server/initializers/database'
|
||||
import * as program from 'commander'
|
||||
import { PluginManager } from '../../server/lib/plugins/plugin-manager'
|
||||
import { isAbsolute } from 'path'
|
||||
|
||||
program
|
||||
.option('-n, --package-name [packageName]', 'Package name to install')
|
||||
.parse(process.argv)
|
||||
|
||||
if (!program['packageName']) {
|
||||
console.error('You need to specify the plugin name.')
|
||||
process.exit(-1)
|
||||
}
|
||||
|
||||
run()
|
||||
.then(() => process.exit(0))
|
||||
.catch(err => {
|
||||
console.error(err)
|
||||
process.exit(-1)
|
||||
})
|
||||
|
||||
async function run () {
|
||||
await initDatabaseModels(true)
|
||||
|
||||
const toUninstall = program['packageName']
|
||||
await PluginManager.Instance.uninstall(toUninstall)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue