|
|
@ -159,6 +159,7 @@ export function scaffold({
|
|
|
|
|
|
|
|
|
|
|
|
const dir =
|
|
|
|
const dir =
|
|
|
|
root === './' ? `` : ` ${root.replace(/^\.\//, '').replace(/[/\\]$/, '')}`
|
|
|
|
root === './' ? `` : ` ${root.replace(/^\.\//, '').replace(/[/\\]$/, '')}`
|
|
|
|
|
|
|
|
const gitignorePrefix = dir ? `${dir}/.vitepress` : '.vitepress'
|
|
|
|
|
|
|
|
|
|
|
|
const pkgPath = path.resolve('package.json')
|
|
|
|
const pkgPath = path.resolve('package.json')
|
|
|
|
const userPkg = fs.existsSync(pkgPath)
|
|
|
|
const userPkg = fs.existsSync(pkgPath)
|
|
|
@ -168,8 +169,9 @@ export function scaffold({
|
|
|
|
const tips = []
|
|
|
|
const tips = []
|
|
|
|
if (fs.existsSync('.git')) {
|
|
|
|
if (fs.existsSync('.git')) {
|
|
|
|
tips.push(
|
|
|
|
tips.push(
|
|
|
|
`Make sure to add ${cyan(`.vitepress/dist`)} and ` +
|
|
|
|
`Make sure to add ${cyan(`${gitignorePrefix}/dist`)} and ` +
|
|
|
|
`${cyan(`.vitepress/cache`)} to your ${cyan(`.gitignore`)} file.`
|
|
|
|
`${cyan(`${gitignorePrefix}/cache`)} to your ` +
|
|
|
|
|
|
|
|
`${cyan(`.gitignore`)} file.`
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (
|
|
|
|
if (
|
|
|
|