Skip to content

Commit

Permalink
fix a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
r4zendev committed Sep 27, 2024
1 parent f71bd46 commit c6e820c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/Runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,19 @@ function run(transformFile, paths, options) {
})
.on('end', () => {
const ext = path.extname(transformFile);
const path = path.join(
os.tmpdir(),
`jscodeshift-${crypto.randomBytes(8).toString('hex')}`,
ext
);
remoteScriptPath = path;

fs.writeFile(
path.join(
os.tmpdir(),
`jscodeshift-${crypto.randomBytes(8).toString('hex')}`,
ext
),
path,
contents,
"utf8",
(err, path) => {
(err) => {
if (err) return reject(err);
remoteScriptPath = path;
transform(path).then(resolve, reject);
}
);
Expand Down

0 comments on commit c6e820c

Please sign in to comment.