mirror of
https://github.com/withastro/astro.git
synced 2025-02-03 22:29:08 -05:00
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:
parent
6606245b35
commit
2c07656c8d
2 changed files with 2 additions and 3 deletions
|
@ -410,7 +410,7 @@ export function createRelativeSchema(cmd: string, fileProtocolRoot: string) {
|
||||||
})
|
})
|
||||||
.refine((obj) => !obj.outDir.toString().startsWith(obj.publicDir.toString()), {
|
.refine((obj) => !obj.outDir.toString().startsWith(obj.publicDir.toString()), {
|
||||||
message:
|
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;
|
return AstroConfigRelativeSchema;
|
||||||
|
|
|
@ -74,8 +74,7 @@ describe('Config Validation', () => {
|
||||||
);
|
);
|
||||||
expect(configError instanceof z.ZodError).to.equal(true);
|
expect(configError instanceof z.ZodError).to.equal(true);
|
||||||
expect(configError.errors[0].message).to.equal(
|
expect(configError.errors[0].message).to.equal(
|
||||||
'`outDir` must not be placed inside `publicDir` to prevent an infinite loop. \
|
'The value of `outDir` must not point to a path within the folder set as `publicDir`, this will cause an infinite loop'
|
||||||
Please adjust the directory configuration and try again'
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue