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.

Installer.ts 809B

123456789101112131415161718192021222324
  1. import { Plugin } from "./Plugin"
  2. import { getLogger } from "frontblock-generic/Types"
  3. import { FrontworkAdmin } from "./Admin";
  4. var exec = require('child-process-promise').exec;
  5. const logger = getLogger("installer", 'info')
  6. export type NPMPkgName = string
  7. export type NPMVersion = string
  8. export const installAdmin = (plugins: Plugin[] = []) => {
  9. const npmPkgs:[NPMPkgName, NPMVersion][] = [['sqlite3', '4.1.0'], ['knex', '0.19.2']]
  10. const deps = npmPkgs.map(tuple => tuple.join('@') ).join(" ")
  11. logger.info("Installing plaform dependencies: "+deps)
  12. exec("npm i " + deps).then(async process => {
  13. logger.debug(process.stdout)
  14. const Admin = require("./Admin").FrontworkAdmin
  15. const fbAdmin:FrontworkAdmin = new Admin(plugins)
  16. fbAdmin.start()
  17. })
  18. }