Skip to content

Commit

Permalink
docs: add root path to gitignore suggestion (#2488)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lehoczky authored Aug 8, 2023
1 parent c9d4655 commit 819eb51
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/node/init/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export function scaffold({

const dir =
root === './' ? `` : ` ${root.replace(/^\.\//, '').replace(/[/\\]$/, '')}`
const gitignorePrefix = dir ? `${dir}/.vitepress` : '.vitepress'

const pkgPath = path.resolve('package.json')
const userPkg = fs.existsSync(pkgPath)
Expand All @@ -168,8 +169,9 @@ export function scaffold({
const tips = []
if (fs.existsSync('.git')) {
tips.push(
`Make sure to add ${cyan(`.vitepress/dist`)} and ` +
`${cyan(`.vitepress/cache`)} to your ${cyan(`.gitignore`)} file.`
`Make sure to add ${cyan(`${gitignorePrefix}/dist`)} and ` +
`${cyan(`${gitignorePrefix}/cache`)} to your ` +
`${cyan(`.gitignore`)} file.`
)
}
if (
Expand Down

0 comments on commit 819eb51

Please sign in to comment.