initial implementation of running node setup on branch switch in httpinterface
This commit is contained in:
1 parent
978c6be82c
commit
90377568ac
4 files changed
+25
-40
No files matched your search
@@ -900,6 +900,28 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
|
||||
async function runNodeSetup () {
|
||||
console.log( "lets run node setup" )
|
||||
const path = require("path");
|
||||
const process = require("process");
|
||||
const { exec } = require("child_process");
|
||||
|
||||
let dir = path.join( process.cwd(), "..", ".." )
|
||||
let command = "node setup";
|
||||
exec( command,
|
||||
{
|
||||
cwd: dir
|
||||
},
|
||||
function ( error, stdout ){
|
||||
if (error) {
|
||||
console.log('');
|
||||
console.log("There was an error updating dependencies for this branch: ");
|
||||
console.log('');
|
||||
console.log( error );
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('');
|
||||
console.log( stdout );
|
||||
});
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
|
||||
@@ -18,10 +18,9 @@ function newEducationActionSwitch() {
|
||||
|
||||
async function executeAction(action) {
|
||||
switch (action.name) {
|
||||
case 'Launch Shell Command':
|
||||
{
|
||||
UI.projects.education.functionLibraries.launchshellcommand.launchshellcommand(action.node)
|
||||
}
|
||||
case 'Action Name': {
|
||||
// Example: return UI.projects.foundations.functionLibraries.onFocus.getNodeThatIsOnFocus(action.node)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
const path = require("path");
|
||||
const process = require("process");
|
||||
const { exec } = require("child_process");
|
||||
|
||||
function newEducationFunctionLibraryLaunchShellCommand() {
|
||||
let thisObject = {
|
||||
launchShellCommand: launchShellCommand
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
function launchShellCommand() {
|
||||
|
||||
|
||||
let dir = path.join( process.cwd(), "..", "..", "..", "..", ".." )
|
||||
let command = "node setup";
|
||||
exec( command,
|
||||
{
|
||||
cwd: dir
|
||||
},
|
||||
function ( error, stdout ){
|
||||
if (error) {
|
||||
console.log('');
|
||||
console.log("There was an error updating dependencies for this branch: ");
|
||||
console.log('');
|
||||
console.log( error );
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('');
|
||||
console.log( stdout );
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -254,8 +254,6 @@ function newEducationDocSpace() {
|
||||
|
||||
if (doNotNavigate === true) { return }
|
||||
|
||||
// Run Node Setup to Update dependencies upon branch switch
|
||||
|
||||
UI.projects.education.spaces.docsSpace.navigateTo('Foundations', 'Topic', 'Switching Branches - Current Branch Changed')
|
||||
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user