diff --git a/applications/daily_tests/cron_jobs.js b/applications/daily_tests/cron_jobs.js index d3041c6250..a353bdc217 100644 --- a/applications/daily_tests/cron_jobs.js +++ b/applications/daily_tests/cron_jobs.js @@ -123,6 +123,10 @@ ${logLines.join("\n")} async function main() { console.log("👩‍💻 Updating repo..."); + await git.reset(__dirname).catch((err) => { + console.error("🚨 Failed to do git reset --hard"); + console.error(err); + }); await git.pull(__dirname).catch((err) => { console.error("🚨 Failed to update git repo"); console.error(err); diff --git a/applications/daily_tests/helpers.js b/applications/daily_tests/helpers.js index 1dd97a016f..e01c6608fd 100644 --- a/applications/daily_tests/helpers.js +++ b/applications/daily_tests/helpers.js @@ -154,10 +154,10 @@ async function monitorProcessOutput({ } const git = { - pull(cwd = null) { + command(params, cwd = null) { cwd = cwd || process.cwd(); return new Promise((resolve, reject) => { - let ps = spawn("git", ["pull", "--rebase"], { cwd }); + let ps = spawn("git", params, { cwd }); ps.stdout.on("data", (buf) => { console.log(buf.toString()); }); @@ -173,6 +173,8 @@ const git = { }); }); }, + reset: (cwd = null) => git.command(["reset", "--hard"], cwd), + pull: (cwd = null) => git.command(["pull", "--rebase"], cwd), }; module.exports = {