Bug fiexs
This commit is contained in:
1 parent
76a0a8c764
commit
9e0f01f8aa
2 files changed
+14
-9
No files matched your search
+12
-7
@@ -654,13 +654,13 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
|
||||
checkout()
|
||||
|
||||
async function checkout() {
|
||||
let message = await doGit()
|
||||
let result = await doGit()
|
||||
|
||||
let customResponse = {
|
||||
result: global.CUSTOM_OK_RESPONSE.result,
|
||||
message: message
|
||||
if (result === true) {
|
||||
respondWithContent(JSON.stringify(global.DEFAULT_OK_RESPONSE), httpResponse)
|
||||
} else {
|
||||
respondWithContent(JSON.stringify(global.FAIL_OK_RESPONSE), httpResponse)
|
||||
}
|
||||
respondWithContent(JSON.stringify(customResponse), httpResponse)
|
||||
}
|
||||
|
||||
async function doGit() {
|
||||
@@ -671,8 +671,13 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
|
||||
maxConcurrentProcesses: 6,
|
||||
}
|
||||
const git = simpleGit(options)
|
||||
|
||||
return await git.checkoutBranch(currentBranch)
|
||||
console.log('checkout ' + currentBranch)
|
||||
try {
|
||||
await git.checkoutBranch(currentBranch)
|
||||
} catch (err) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
|
||||
@@ -186,13 +186,13 @@ function newSuperalgosDocSpace() {
|
||||
|
||||
function changeActiveBranch(branch) {
|
||||
window.localStorage.setItem('Current Branch', UI.projects.superalgos.spaces.docsSpace.currentBranch)
|
||||
httpRequest(undefined, 'App/Checkout/' + UI.projects.superalgos.spaces.docsSpace.currentBranch, onResponse)
|
||||
httpRequest(undefined, 'App/Checkout/' + branch, onResponse)
|
||||
UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'Switching Branches - Changing Current Branch')
|
||||
|
||||
function onResponse(err, data) {
|
||||
/* Lets check the result of the call through the http interface */
|
||||
data = JSON.parse(data)
|
||||
if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result && data.result === GLOBAL.CUSTOM_OK_RESPONSE.result) {
|
||||
if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result && data.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
|
||||
UI.projects.superalgos.spaces.docsSpace.currentBranch = branch
|
||||
UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'Switching Branches - Current Branch Changed')
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user