mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-27 06:43:19 +08:00
Give the fs corpus programs per-process scratch directories (#1709)
This commit is contained in:
@@ -15,7 +15,7 @@ function tail(path: string): string {
|
||||
}
|
||||
return path.slice(i + 1);
|
||||
}
|
||||
const dir = `/tmp/scr-dirent-${tail(process.argv[1] === undefined ? "x" : process.argv[1])}`;
|
||||
const dir = `/tmp/scr-dirent-${tail(process.argv[1] === undefined ? "x" : process.argv[1])}-${process.pid}`;
|
||||
if (fs.existsSync(dir)) fs.rmSync(dir, { recursive: true, force: true });
|
||||
fs.mkdirSync(dir);
|
||||
fs.mkdirSync(`${dir}/sub-a`);
|
||||
|
||||
@@ -9,7 +9,7 @@ function tail(path) {
|
||||
while (i >= 0 && path.charAt(i) !== "/" && path.charAt(i) !== "\\") i = i - 1;
|
||||
return path.slice(i + 1);
|
||||
}
|
||||
const dir = `/tmp/scr-dirent-untyped-${tail(process.argv[1] === undefined ? "x" : process.argv[1])}`;
|
||||
const dir = `/tmp/scr-dirent-untyped-${tail(process.argv[1] === undefined ? "x" : process.argv[1])}-${process.pid}`;
|
||||
if (fs.existsSync(dir)) fs.rmSync(dir, { recursive: true, force: true });
|
||||
fs.mkdirSync(`${dir}/sub`, { recursive: true });
|
||||
fs.writeFileSync(`${dir}/a.txt`, "x");
|
||||
|
||||
@@ -8,7 +8,7 @@ function tail(path: string): string {
|
||||
while (i >= 0 && path.charAt(i) !== "/" && path.charAt(i) !== "\\") i = i - 1;
|
||||
return path.slice(i + 1);
|
||||
}
|
||||
const root = `/tmp/scr-cpsync-${tail(process.argv[1] === undefined ? "x" : process.argv[1])}`;
|
||||
const root = `/tmp/scr-cpsync-${tail(process.argv[1] === undefined ? "x" : process.argv[1])}-${process.pid}`;
|
||||
if (fs.existsSync(root)) fs.rmSync(root, { recursive: true, force: true });
|
||||
fs.mkdirSync(root);
|
||||
const home = process.cwd();
|
||||
|
||||
@@ -11,7 +11,7 @@ function tail(path) {
|
||||
while (i >= 0 && path.charAt(i) !== "/" && path.charAt(i) !== "\\") i = i - 1;
|
||||
return path.slice(i + 1);
|
||||
}
|
||||
const root = `/tmp/scr-cp-errors-${tail(process.argv[1] === undefined ? "x" : process.argv[1])}`;
|
||||
const root = `/tmp/scr-cp-errors-${tail(process.argv[1] === undefined ? "x" : process.argv[1])}-${process.pid}`;
|
||||
if (fs.existsSync(root)) fs.rmSync(root, { recursive: true, force: true });
|
||||
fs.mkdirSync(root);
|
||||
const home = process.cwd();
|
||||
|
||||
@@ -9,7 +9,7 @@ function tail(path: string): string {
|
||||
while (i >= 0 && path.charAt(i) !== "/" && path.charAt(i) !== "\\") i = i - 1;
|
||||
return path.slice(i + 1);
|
||||
}
|
||||
const root = `/tmp/scr-cp-links-${tail(process.argv[1] === undefined ? "x" : process.argv[1])}`;
|
||||
const root = `/tmp/scr-cp-links-${tail(process.argv[1] === undefined ? "x" : process.argv[1])}-${process.pid}`;
|
||||
if (fs.existsSync(root)) fs.rmSync(root, { recursive: true, force: true });
|
||||
fs.mkdirSync(root);
|
||||
const home = process.cwd();
|
||||
|
||||
@@ -9,7 +9,7 @@ function tail(path: string): string {
|
||||
while (i >= 0 && path.charAt(i) !== "/" && path.charAt(i) !== "\\") i = i - 1;
|
||||
return path.slice(i + 1);
|
||||
}
|
||||
const root = `/tmp/scr-cp-async-${tail(process.argv[1] === undefined ? "x" : process.argv[1])}`;
|
||||
const root = `/tmp/scr-cp-async-${tail(process.argv[1] === undefined ? "x" : process.argv[1])}-${process.pid}`;
|
||||
if (fs.existsSync(root)) fs.rmSync(root, { recursive: true, force: true });
|
||||
fs.mkdirSync(root);
|
||||
const home = process.cwd();
|
||||
|
||||
Reference in New Issue
Block a user