break up git commands

This commit is contained in:
Brenden Harrell committed 2021-10-10 21:52:59 -05:00
1 parent baf64da77c
commit ae7eaad7ba
1 file changed
+4 -3
+4 -3
View File
@@ -892,9 +892,10 @@ exports.newHttpInterface = function newHttpInterface() {
const git = simpleGit(options)
try {
await git.checkout(currentBranch)
let postCheckoutCommands = ['pull', `https://github.com/Superalgos/Superalgos.git ${currentBranch}`, 'reset', `--hard https://github.com/Superalgos/Superalgos.git/${currentBranch}`]
let result = await git.raw(postCheckoutCommands);
console.log(result)
let postCheckoutCommands = ['pull', `https://github.com/Superalgos/Superalgos.git ${currentBranch}`]
await git.raw(postCheckoutCommands);
let updateToMainRepo = ['reset', `--hard https://github.com/Superalgos/Superalgos.git/${currentBranch}`]
await git.raw(updateToMainRepo);
} catch (err) {
console.log('[ERROR] Error changing current branch to ' + currentBranch)