From ee95500bbde2d408244a3a4bbc7ed266c5eb4736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alfonso=20G=C3=B3mez-Arzola?= Date: Thu, 21 Oct 2021 14:09:18 -0400 Subject: [PATCH] Run theme build command with bash in login mode (#43) --- src/Robo/Plugin/Commands/ThemeCommands.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Robo/Plugin/Commands/ThemeCommands.php b/src/Robo/Plugin/Commands/ThemeCommands.php index 13dacdc..c46fd83 100644 --- a/src/Robo/Plugin/Commands/ThemeCommands.php +++ b/src/Robo/Plugin/Commands/ThemeCommands.php @@ -48,7 +48,10 @@ public function themeBuild($siteName = 'default'): Result $themePath = $themeConfig['theme_path']; $this->io()->section("building theme at $themePath"); foreach ($themeConfig['theme_build_commands'] as $themeBuildCommand) { - $result = $this->taskExec($themeBuildCommand) + // Run theme build commands in a Bash subshell with login mode + // enabled to ensure nvm is loaded prior to running any + // Node-based commands. + $result = $this->taskExec("bash -lc \"$themeBuildCommand\"") ->dir($themePath) ->run(); }