From 17da34caed870d32b4fb36c61fa4ac4f5b3e9319 Mon Sep 17 00:00:00 2001 From: Juan Tejada Date: Tue, 21 Mar 2017 09:25:46 -0700 Subject: [PATCH] [dev] Fix temp dir path in daily --- scripts/daily.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/daily.js b/scripts/daily.js index 256bd05a8..053b4ca59 100644 --- a/scripts/daily.js +++ b/scripts/daily.js @@ -41,10 +41,11 @@ function git(subCmd, opts = {}) { } async function prependToFile(filepath, string) { - mkdirp.sync(path.join(__dirname, '..', 'tmp')) - await exec(`echo "${string}" > ./tmp/tmpfile`) - await exec(`cat ${filepath} >> ./tmp/tmpfile`) - await exec(`mv ./tmp/tmpfile ${filepath}`) + const tmpDir = path.join(__dirname, '..', 'tmp') + mkdirp.sync(tmpDir) + await exec(`echo "${string}" > ${tmpDir}/tmpfile`) + await exec(`cat ${filepath} >> ${tmpDir}/tmpfile`) + await exec(`mv ${tmpDir}/tmpfile ${filepath}`) } async function sliceFileLines(filepath, idx) {