docsify/build/cover.js

15 lines
406 B
JavaScript
Raw Normal View History

2017-05-31 08:25:00 +08:00
var fs = require('fs')
var read = fs.readFileSync
var write = fs.writeFileSync
var version = process.env.VERSION || require('../package.json').version
var file = __dirname + '/../docs/_coverpage.md'
var cover = read(file, 'utf8').toString()
console.log('Replace version number in cover page...')
2017-09-22 10:07:10 +08:00
cover = cover.replace(
/<small>(\S+)?<\/small>/g,
'<small>' + version + '</small>'
)
2017-05-31 08:25:00 +08:00
write(file, cover)