Merge pull request #2089 from harrellbm/develop
Run node setup on branch switch
This commit is contained in:
2 files changed
+21
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user