Skip to content
Snippets Groups Projects
Commit e8dce681 authored by Xiao Gui's avatar Xiao Gui
Browse files

bugfix: catch if output dir does not exist

parent abca190a
No related branches found
No related tags found
No related merge requests found
......@@ -50,9 +50,11 @@ const outputPath = path.resolve(__dirname,'../dist/aot')
compileQuickOnePager()
.then(html => {
const fs = require('fs')
fs.writeFile(path.join(outputPath, 'quickstart.html'), html, 'utf-8', (err) => {
if (err) throw new Error(`quickOnePager cannot be written to disk`)
})
const { execSync } = require('child_process')
const { promisify } = require('util')
const asyncWrite = promisify(fs.writeFile)
execSync(`mkdir -p ${outputPath}`)
return asyncWrite(path.join(outputPath, 'quickstart.html'), html, 'utf-8')
})
.catch(e => {
console.warn(e)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment