Error if cache folder is outside project
This commit is contained in:
+3
-6
@@ -64,13 +64,10 @@ export default async (
|
|||||||
const cacheFolderAbs = configuration.get(`cacheFolder`);
|
const cacheFolderAbs = configuration.get(`cacheFolder`);
|
||||||
let cacheFolderExpr: string;
|
let cacheFolderExpr: string;
|
||||||
if (cacheFolderAbs.startsWith(cwd)) {
|
if (cacheFolderAbs.startsWith(cwd)) {
|
||||||
cacheFolderExpr =
|
cacheFolderExpr = json(ppath.relative(cwd, cacheFolderAbs));
|
||||||
"./" + ppath.relative(ppath.dirname(nixExprPath), cacheFolderAbs);
|
|
||||||
} else {
|
} else {
|
||||||
cacheFolderExpr = json(cacheFolderAbs);
|
throw Error(
|
||||||
report.reportWarning(
|
`The cache folder ${cacheFolderAbs} is outside the project, this is currently not supported`
|
||||||
0,
|
|
||||||
`The cache folder ${cacheFolderAbs} is outside the project - it may not be reachable by the Nix build`
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user