Merge pull request #2089 from harrellbm/develop

Run node setup on branch switch
This commit is contained in:
Luis Fernando Molina authored and GitHub committed 2021-10-08 13:19:04 -04:00
commit 4469ee99c7
2 files changed
+21

No files matched your search

+19
View File
@@ -864,6 +864,9 @@ exports.newHttpInterface = function newHttpInterface() {
await doGit()
if (error === undefined) {
// Run node setup to prepare instance for branch change
await runNodeSetup()
// Return to UI that Branch is suggessfully changed
SA.projects.foundations.utilities.httpResponses.respondWithContent(JSON.stringify(global.DEFAULT_OK_RESPONSE), httpResponse)
} else {
let docs = {
@@ -896,6 +899,22 @@ exports.newHttpInterface = function newHttpInterface() {
}
}
async function runNodeSetup () {
console.log( "Running Node setup to adjust for new Branch" )
const process = require("process");
const { execSync } = require("child_process");
let dir = process.cwd()
let command = "node setup";
let stdout = execSync( command,
{
cwd: dir
}).toString();
console.log("Node Setup has completed with the following result:", stdout)
}
} catch (err) {
console.log('[ERROR] httpInterface -> App -> Update -> Method call produced an error.')
console.log('[ERROR] httpInterface -> App -> Update -> err.stack = ' + err.stack)
@@ -253,7 +253,9 @@ function newEducationDocSpace() {
UI.projects.foundations.utilities.nodeConfig.saveConfigProperty(workspace.payload, 'currentBranch', branch)
if (doNotNavigate === true) { return }
UI.projects.education.spaces.docsSpace.navigateTo('Foundations', 'Topic', 'Switching Branches - Current Branch Changed')
} else {
UI.projects.education.spaces.docsSpace.navigateTo(
data.docs.project,