Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
kabalin committed Aug 22, 2024
1 parent 729d6bd commit 0baa666
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Installer/VendorInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use MoodlePluginCI\Bridge\Moodle;
use MoodlePluginCI\Bridge\MoodlePlugin;
use MoodlePluginCI\Process\Execute;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Process\Process;

/**
Expand Down Expand Up @@ -112,15 +113,16 @@ public function canInstallNvm(): bool
*/
public function installNvm(): void
{
$cmd = 'curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash';
$nvmDir = "{$this->moodle->directory}/.nvm";
(new Filesystem())->mkdir($nvmDir);
$cmd = "curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | NVM_DIR={$nvmDir} bash";
$process = $this->execute->passThroughProcess(
Process::fromShellCommandline($cmd, $this->moodle->directory, null, null, null)
);
if (!$process->isSuccessful()) {
throw new \RuntimeException('nvm installation failed.');
}
$home = getenv('HOME');
putenv("NVM_DIR={$home}/.nvm");
putenv("NVM_DIR={$nvmDir}");
}

/**
Expand Down

0 comments on commit 0baa666

Please sign in to comment.