Skip to content

Commit 3072f0c

Browse files
committed
fix format crashes when user pass weird input like xx/../hello.js
1 parent 3071e41 commit 3072f0c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/rescript_format.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ function main(argv, rescript_exe, bsc_exe) {
114114
var os = require("os");
115115
var filename = path.join(
116116
os.tmpdir(),
117-
"rescript_" + crypto.randomBytes(8).toString("hex") + use_stdin
117+
"rescript_" + crypto.randomBytes(8).toString("hex") + path.parse(use_stdin).base
118118
);
119119
(async function () {
120120
var content = await readStdin();

0 commit comments

Comments
 (0)