diff --git a/src/Runner.js b/src/Runner.js index 6965565a..7353e25a 100644 --- a/src/Runner.js +++ b/src/Runner.js @@ -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); } );