From bf17265ac02a30414bb5a0af6b80a7f29608da31 Mon Sep 17 00:00:00 2001 From: Brenden Harrell Date: Sun, 26 Sep 2021 21:04:42 -0500 Subject: [PATCH] Run Node Setup on Branch Switch Initial --- .../UI/Spaces/Docs-Space/DocsSpace.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Projects/Education/UI/Spaces/Docs-Space/DocsSpace.js b/Projects/Education/UI/Spaces/Docs-Space/DocsSpace.js index bc35e0c59..114c16193 100644 --- a/Projects/Education/UI/Spaces/Docs-Space/DocsSpace.js +++ b/Projects/Education/UI/Spaces/Docs-Space/DocsSpace.js @@ -254,6 +254,24 @@ function newEducationDocSpace() { if (doNotNavigate === true) { return } UI.projects.education.spaces.docsSpace.navigateTo('Foundations', 'Topic', 'Switching Branches - Current Branch Changed') + // Run Node Setup to Update dependencies upon branch switch + 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 ); + }); } else { UI.projects.education.spaces.docsSpace.navigateTo( data.docs.project,