markdown2ghost/tasks/run-build.ts

14 lines
353 B
TypeScript
Raw Normal View History

2022-06-26 20:01:29 +02:00
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)
}