Skip to content

Commit

Permalink
docs: adjust install and init commands
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd committed Apr 7, 2024
1 parent 5832402 commit 54c46e7
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 17 deletions.
14 changes: 11 additions & 3 deletions docs/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ $ npx vitepress init
$ pnpm vitepress init
```

```sh [yarn]
$ yarn vitepress init
```

```sh [bun]
$ bunx vitepress init
$ bun vitepress init
```

:::
Expand Down Expand Up @@ -182,11 +186,15 @@ $ npx vitepress dev docs
```

```sh [pnpm]
$ pnpm exec vitepress dev docs
$ pnpm vitepress dev docs
```

```sh [yarn]
$ yarn vitepress dev docs
```

```sh [bun]
$ bunx vitepress dev docs
$ bun vitepress dev docs
```

:::
Expand Down
14 changes: 11 additions & 3 deletions docs/pt/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ $ npx vitepress init
$ pnpm vitepress init
```

```sh [yarn]
$ yarn vitepress init
```

```sh [bun]
$ bunx vitepress init
$ bun vitepress init
```

:::
Expand Down Expand Up @@ -182,11 +186,15 @@ $ npx vitepress dev docs
```

```sh [pnpm]
$ pnpm exec vitepress dev docs
$ pnpm vitepress dev docs
```

```sh [yarn]
$ yarn vitepress dev docs
```

```sh [bun]
$ bunx vitepress dev docs
$ bun vitepress dev docs
```

:::
Expand Down
14 changes: 11 additions & 3 deletions docs/ru/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ $ npx vitepress init
$ pnpm vitepress init
```

```sh [yarn]
$ yarn vitepress init
```

```sh [bun]
$ bunx vitepress init
$ bun vitepress init
```

:::
Expand Down Expand Up @@ -182,11 +186,15 @@ $ npx vitepress dev docs
```

```sh [pnpm]
$ pnpm exec vitepress dev docs
$ pnpm vitepress dev docs
```

```sh [yarn]
$ yarn vitepress dev docs
```

```sh [bun]
$ bunx vitepress dev docs
$ bun vitepress dev docs
```

:::
Expand Down
14 changes: 11 additions & 3 deletions docs/zh/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ $ npx vitepress init
$ pnpm vitepress init
```

```sh [yarn]
$ yarn vitepress init
```

```sh [bun]
$ bunx vitepress init
$ bun vitepress init
```

:::
Expand Down Expand Up @@ -182,11 +186,15 @@ $ npx vitepress dev docs
```

```sh [pnpm]
$ pnpm exec vitepress dev docs
$ pnpm vitepress dev docs
```

```sh [yarn]
$ yarn vitepress dev docs
```

```sh [bun]
$ bunx vitepress dev docs
$ bun vitepress dev docs
```

:::
Expand Down
7 changes: 2 additions & 5 deletions src/node/init/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ export interface ScaffoldOptions {

const getPackageManger = () => {
const name = process.env?.npm_config_user_agent || 'npm'
if (name === 'npm') {
return 'npm'
}
return name.split('/')[0]
}

Expand Down Expand Up @@ -211,9 +208,9 @@ export function scaffold({
`${getPackageManger()} run docs:dev`
)} and start writing.${tip}`
} else {
const execCommand = getPackageManger() === 'bun' ? 'bunx' : 'npx'
const pm = getPackageManger()
return `You're all set! Now run ${cyan(
`${execCommand} vitepress dev${dir}`
`${pm === 'npm' ? 'npx' : pm} vitepress dev${dir}`
)} and start writing.${tip}`
}
}

0 comments on commit 54c46e7

Please sign in to comment.