@viewdo/dxp-story-cli
Version:
README.md
37 lines (29 loc) • 1.44 kB
JavaScript
const App = require('./app')
const builder = require('./app/builder')
module.exports = async (options) => {
const app = new App(options)
let story_keys = (options.keys.length ? options.keys : false) ||
await app.prompt_service.selectFromKeys('Story', app.configuration_manager.story_keys, 'Unpack', options.all)
//if(!app.configuration_manager.build) {
// let build = options.build || await app.prompt_service.askIf('Will any of these stories require a build process? [Not recommended for small simple stories]')
// if(build) {
// app.configuration_manager.enableBuilds()
// builder.init(app.root, app.configuration_manager)
// }
// if(build) {
// let source = options.source || await app.prompt_service.askFor(
// 'Source Directory',
// app.configuration_manager.source,
// app.prompt_service.validateFolder)
// app.configuration_manager.source = source
// }
//}
//if(app.configuration_manager.build){
// app.console.log(`Unpacking story assets to source folder ${app.root}`.blue);
// await builder.unpack(story_keys, app.configuration_manager)
// app.console.log(`Unpack successful`.green)
//}
app.console_service.log(`Unpacking story assets from source in folder ${app.root}`.blue)
await builder.unpack(story_keys, app.configuration_manager)
app.console_service.log(`Unpack successful`.green)
}