Skip to content

Commit

Permalink
chore: 确保文档发布过程中持续输出内容,避免 ci 失败
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Dec 26, 2019
1 parent b6cff8e commit edb057b
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions build/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@ const ghPages = require('gh-pages')
const ora = require('ora')
const spinner = ora('Publishing gitbooks...').start()

cp.exec('npm run docs', err => {
if (!err) {
const docs = cp.spawn('npm', ['run', 'docs'])

docs.stdout.on('data', data => {
console.log(data)
})

docs.stderr.on('data', data => {
console.error(data)
})

docs.on('close', code => {
if (code === 0) {
ghPages.publish('./website/build/taro', err => {
if (!err) {
spinner.succeed('Publish successfully.')
Expand All @@ -13,6 +23,10 @@ cp.exec('npm run docs', err => {
}
})
} else {
spinner.fail(err)
spinner.fail(`文档站点编译出错,出错码 ${code}`)
}
})

docs.on('error', error => {
console.log(error)
})

0 comments on commit edb057b

Please sign in to comment.