Skip to content

Commit

Permalink
workflow fork linking test
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhilton committed Aug 9, 2024
1 parent 3842ad1 commit 4c126dd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Installer/VendorInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,20 @@ public function installNode(): void
}

$nvmDir = getenv('NVM_DIR');
$cmd = ". $nvmDir/nvm.sh && nvm install && nvm use && echo \"NVM_BIN=\$NVM_BIN\"";
$cmd = ". $nvmDir/nvm.sh";
$process = $this->execute->passThroughProcess(
Process::fromShellCommandline($cmd, $this->moodle->directory, null, null, null)
);
if (!$process->isSuccessful()) {
throw new \RuntimeException('nvm include failed');
}

$cmd = ". $nvmDir/nvm.sh && nvm install && nvm use && echo \"NVM_BIN=\$NVM_BIN\"";
$process = $this->execute->passThroughProcess(
Process::fromShellCommandline($cmd, $this->moodle->directory, null, null, null)
);
if (!$process->isSuccessful()) {
throw new \RuntimeException('Node.js installation failed.');
throw new \RuntimeException('Node.js installation failed. Output: ' . $process->getOutput() . ' nvm dir: ' . (string) $nvmDir);
}
// Retrieve NVM_BIN from initialisation output, we will use it to
// substitute right Node.js environment in all future process runs.
Expand Down

0 comments on commit 4c126dd

Please sign in to comment.