Skip to content

Commit 22b7943

Browse files
jakub-swierkyyx990803
authored andcommitted
feat: commands now defaults targetDir to cwd. (#25)
close #8
1 parent 9e59191 commit 22b7943

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

bin/vuepress.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ program
1111
.usage('<command> [options]')
1212

1313
program
14-
.command('dev <targetDir>')
14+
.command('dev [targetDir]')
1515
.description('start development server')
1616
.option('-p, --port <port>', 'use specified port (default: 8080)')
17-
.action((dir, { port }) => {
17+
.action((dir = '.', { port }) => {
1818
wrapCommand(dev)(path.resolve(dir), { port })
1919
})
2020

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

docs/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ npm install -g vuepress
2323
echo "# Hello VuePress" > README.md
2424

2525
# start writing
26-
vuepress dev .
26+
vuepress dev
2727

2828
# build to static files
29-
vuepress build .
29+
vuepress build
3030
```

docs/guide/getting-started.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ npm install -g vuepress
1212
echo "# Hello VuePress" > README.md
1313

1414
# start writing
15-
vuepress dev .
15+
vuepress dev
1616

1717
# build
18-
vuepress build .
18+
vuepress build
1919
```
2020

2121
## Inside an Existing Project

0 commit comments

Comments
 (0)