-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
69d5d66
commit ef0ba57
Showing
6 changed files
with
53 additions
and
50 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
#!/usr/bin/env node | ||
import { cac } from 'cac' | ||
import { createCommand } from 'commander' | ||
import { mainAction } from './action.js' | ||
import { version } from './utils/index.js' | ||
|
||
const cli = cac('create-vuepress') | ||
const program = createCommand('create-vuepress') | ||
|
||
cli | ||
.command('[dir]', 'Generate a new vuepress project in [dir]') | ||
.option('-t, --theme <theme>', 'Theme to use') | ||
.option('-p, --preset <preset>', 'Preset to use, can be docs or blog') | ||
.usage( | ||
program | ||
.argument('<dir>', 'Dir to create the template in') | ||
.option('-t, --theme [theme]', 'Theme to use') | ||
.option('-p, --preset [preset]', 'Preset to use, docs or blog only') | ||
.description( | ||
`\ | ||
[dir] | ||
Generate a new vuepress template | ||
Generate vuepress template in dir.`, | ||
· pnpm create vuepress <dir> | ||
· npm init vuepress@latest <dir> | ||
· yarn create vuepress <dir> | ||
`, | ||
) | ||
.example('vuepress-project') | ||
.action(mainAction) | ||
|
||
cli.help() | ||
program.version(version) | ||
program.showHelpAfterError('add --help for additional information') | ||
|
||
cli.version(version) | ||
|
||
cli.parse() | ||
await program.parseAsync() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters