Skip to content

Commit

Permalink
Run theme build command with bash in login mode (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
agarzola authored Oct 21, 2021
1 parent fdc868c commit ee95500
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Robo/Plugin/Commands/ThemeCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit ee95500

Please sign in to comment.