Update httpInterface.js

This commit is contained in:
Luis Fernando Molina committed 2021-01-13 13:19:59 +01:00
1 parent 9e0f01f8aa
commit 196729eb8d
1 file changed
+4 -1
+4 -1
View File
@@ -657,8 +657,10 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
let result = await doGit()
if (result === true) {
console.log(true)
respondWithContent(JSON.stringify(global.DEFAULT_OK_RESPONSE), httpResponse)
} else {
console.log(false)
respondWithContent(JSON.stringify(global.FAIL_OK_RESPONSE), httpResponse)
}
}
@@ -671,10 +673,11 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
maxConcurrentProcesses: 6,
}
const git = simpleGit(options)
console.log('checkout ' + currentBranch)
try {
await git.checkoutBranch(currentBranch)
} catch (err) {
console.log('[ERROR] Error changing current branch to ' + currentBranch + err.stack)
console.log(err.stack)
return false
}
return true