UNPKG

@wep2/cli

Version:

Command line for Wepublish Editor 2

39 lines 1.22 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.install = void 0; const update_1 = require("./update"); const childProcess = require('child_process'); async function install(projectName) { console.log('Scaffolding WePublish Editor 2...'); await installDirectus(projectName); await installWep2(projectName); await (0, update_1.unzipWep2)(projectName); await (0, update_1.migrateSchema)(projectName); console.log(`Start wep2 instance by cd into ./${projectName} and run 'npx directus start'`); } exports.install = install; async function installDirectus(projectName) { try { if (!projectName) { throw new Error('Missing Project Name!'); } await childProcess .execSync(`npm init directus-project ${projectName}`, { stdio: [0, 1, 2] }); } catch (error) { console.log(error); } } async function installWep2(projectName) { try { await childProcess .execSync('npm install --save @wep2/editor', { cwd: `./${projectName}`, stdio: [0, 1, 2] }); } catch (error) { console.log(error); } } //# sourceMappingURL=install.js.map