From 819eb515d06d542ea61d27deee38213fd1b31d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lehoczky=20Zolt=C3=A1n?= Date: Tue, 8 Aug 2023 17:55:20 +0200 Subject: [PATCH] docs: add root path to gitignore suggestion (#2488) --- src/node/init/init.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/node/init/init.ts b/src/node/init/init.ts index 792a354035dc..fd2c03f75dc8 100644 --- a/src/node/init/init.ts +++ b/src/node/init/init.ts @@ -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 (