Federated video streaming platform using ActivityPub and P2P in the web browser with Angular. https://joinpeertube.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

37 lines
1.1 KiB

  1. import { program } from 'commander'
  2. import { isAbsolute } from 'path'
  3. import { initDatabaseModels } from '../../server/initializers/database'
  4. import { PluginManager } from '../../server/lib/plugins/plugin-manager'
  5. program
  6. .option('-n, --npm-name [npmName]', 'Plugin to install')
  7. .option('-v, --plugin-version [pluginVersion]', 'Plugin version to install')
  8. .option('-p, --plugin-path [pluginPath]', 'Path of the plugin you want to install')
  9. .parse(process.argv)
  10. const options = program.opts()
  11. if (!options.npmName && !options.pluginPath) {
  12. console.error('You need to specify a plugin name with the desired version, or a plugin path.')
  13. process.exit(-1)
  14. }
  15. if (options.pluginPath && !isAbsolute(options.pluginPath)) {
  16. console.error('Plugin path should be absolute.')
  17. process.exit(-1)
  18. }
  19. run()
  20. .then(() => process.exit(0))
  21. .catch(err => {
  22. console.error(err)
  23. process.exit(-1)
  24. })
  25. async function run () {
  26. await initDatabaseModels(true)
  27. const toInstall = options.npmName || options.pluginPath
  28. await PluginManager.Instance.install(toInstall, options.pluginVersion, !!options.pluginPath)
  29. }