docs: add root path to gitignore suggestion (#2488)

pull/2758/head
Lehoczky Zoltán 1 year ago committed by GitHub
parent c9d465587a
commit 819eb515d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)
@ -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 (

Loading…
Cancel
Save