markdown2ghost/tasks/run-build.ts
2022-06-26 20:01:29 +02:00

14 lines
353 B
TypeScript

import { build } from './build'
import { finishWithFail, finishWithSuccess } from './process'
try {
const args = process.argv.slice(2)
const mode = args.includes('-d') ? 'development' : 'production'
build(mode)
.then(finishWithSuccess.bind(null, 'Successfully built.'))
.catch(finishWithFail)
} catch (error) {
finishWithFail(error)
}