|
|
@ -44,6 +44,7 @@ export async function init() {
|
|
|
|
root: () =>
|
|
|
|
root: () =>
|
|
|
|
text({
|
|
|
|
text({
|
|
|
|
message: 'Where should VitePress initialize the config?',
|
|
|
|
message: 'Where should VitePress initialize the config?',
|
|
|
|
|
|
|
|
defaultValue: './',
|
|
|
|
initialValue: './',
|
|
|
|
initialValue: './',
|
|
|
|
validate(value) {
|
|
|
|
validate(value) {
|
|
|
|
const inputRoot = path.resolve(value)
|
|
|
|
const inputRoot = path.resolve(value)
|
|
|
@ -51,7 +52,7 @@ export async function init() {
|
|
|
|
if (!inputRoot.startsWith(currentRoot)) {
|
|
|
|
if (!inputRoot.startsWith(currentRoot)) {
|
|
|
|
return 'Please make sure directory is inside'
|
|
|
|
return 'Please make sure directory is inside'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (fs.pathExistsSync(inputRoot)) {
|
|
|
|
if (inputRoot != currentRoot && fs.pathExistsSync(inputRoot)) {
|
|
|
|
return `${value} already exists`
|
|
|
|
return `${value} already exists`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|