Skip to content

Commit

Permalink
fix: daily test
Browse files Browse the repository at this point in the history
  • Loading branch information
Cifko committed Feb 9, 2022
1 parent 2ccf9a8 commit f6132f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions applications/daily_tests/cron_jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 4 additions & 2 deletions applications/daily_tests/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
Expand All @@ -173,6 +173,8 @@ const git = {
});
});
},
reset: (cwd = null) => git.command(["reset", "--hard"], cwd),
pull: (cwd = null) => git.command(["pull", "--rebase"], cwd),
};

module.exports = {
Expand Down

0 comments on commit f6132f3

Please sign in to comment.