Skip to content

Commit 819eb51

Browse files
authored
docs: add root path to gitignore suggestion (#2488)
1 parent c9d4655 commit 819eb51

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: src/node/init/init.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ export function scaffold({
159159

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

163164
const pkgPath = path.resolve('package.json')
164165
const userPkg = fs.existsSync(pkgPath)
@@ -168,8 +169,9 @@ export function scaffold({
168169
const tips = []
169170
if (fs.existsSync('.git')) {
170171
tips.push(
171-
`Make sure to add ${cyan(`.vitepress/dist`)} and ` +
172-
`${cyan(`.vitepress/cache`)} to your ${cyan(`.gitignore`)} file.`
172+
`Make sure to add ${cyan(`${gitignorePrefix}/dist`)} and ` +
173+
`${cyan(`${gitignorePrefix}/cache`)} to your ` +
174+
`${cyan(`.gitignore`)} file.`
173175
)
174176
}
175177
if (

0 commit comments

Comments
 (0)