Update config error message for outDir infinity loop error (#8220)

Co-authored-by: Elian ️ <hello@elian.codes>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
This commit is contained in:
André Alves 2023-08-25 11:25:59 -03:00 committed by GitHub
parent 6606245b35
commit 2c07656c8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View file

@ -410,7 +410,7 @@ export function createRelativeSchema(cmd: string, fileProtocolRoot: string) {
})
.refine((obj) => !obj.outDir.toString().startsWith(obj.publicDir.toString()), {
message:
'`outDir` must not be placed inside `publicDir` to prevent an infinite loop. Please adjust the directory configuration and try again',
'The value of `outDir` must not point to a path within the folder set as `publicDir`, this will cause an infinite loop',
});
return AstroConfigRelativeSchema;

View file

@ -74,8 +74,7 @@ describe('Config Validation', () => {
);
expect(configError instanceof z.ZodError).to.equal(true);
expect(configError.errors[0].message).to.equal(
'`outDir` must not be placed inside `publicDir` to prevent an infinite loop. \
Please adjust the directory configuration and try again'
'The value of `outDir` must not point to a path within the folder set as `publicDir`, this will cause an infinite loop'
);
});
});