Skip to content

Commit

Permalink
feat: commands now defaults targetDir to cwd. (#25)
Browse files Browse the repository at this point in the history
close #8
  • Loading branch information
jakub-swierk authored and yyx990803 committed Apr 14, 2018
1 parent 9e59191 commit 22b7943
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions bin/vuepress.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ program
.usage('<command> [options]')

program
.command('dev <targetDir>')
.command('dev [targetDir]')
.description('start development server')
.option('-p, --port <port>', 'use specified port (default: 8080)')
.action((dir, { port }) => {
.action((dir = '.', { port }) => {
wrapCommand(dev)(path.resolve(dir), { port })
})

program
.command('build <targetDir>')
.command('build [targetDir]')
.description('build dir as static site')
.option('-d, --dest <outDir>', 'specify build output dir (default: .vuepress/dist)')
.option('--debug', 'build in development mode for debugging')
.action((dir, { debug, outDir }) => {
.action((dir = '.', { debug, outDir }) => {
wrapCommand(build)(path.resolve(dir), { debug, outDir })
})

Expand Down
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ npm install -g vuepress
echo "# Hello VuePress" > README.md

# start writing
vuepress dev .
vuepress dev

# build to static files
vuepress build .
vuepress build
```
4 changes: 2 additions & 2 deletions docs/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ npm install -g vuepress
echo "# Hello VuePress" > README.md

# start writing
vuepress dev .
vuepress dev

# build
vuepress build .
vuepress build
```

## Inside an Existing Project
Expand Down

0 comments on commit 22b7943

Please sign in to comment.