Skip to content

Commit

Permalink
feat: vuepress eject for customizing default theme
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Apr 15, 2018
1 parent b3e1e5e commit 89538fa
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bin/vuepress.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ program
wrapCommand(build)(path.resolve(dir), { debug, outDir })
})

program
.command('eject [targetDir]')
.description('copy the default theme into .vuepress/theme for customization.')
.action(async (dir = '.') => {
const { copy } = require('fs-extra')
const source = path.resolve(__dirname, '../lib/default-theme')
const target = path.resolve(dir, '.vuepress/theme')
await copy(source, target)
console.log(`Copied default theme into ${chalk.cyan(target)}.`)
})

// output help information on unknown commands
program
.arguments('<command>')
Expand Down

0 comments on commit 89538fa

Please sign in to comment.