sweetchuck / robo-nvm
Robo task wrapper for NVM commands.
Installs: 98 399
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:robo-tasks
Requires
- php: >=7.3
- consolidation/robo: ^2.0
- danielstjules/stringy: ^3.1
- sweetchuck/utils: ^1.0
Requires (Dev)
- ext-json: *
- codeception/codeception: ^4.0
- codeception/module-asserts: ^1.1
- squizlabs/php_codesniffer: ^3.5
- sweetchuck/codeception-module-robo-task-runner: ^0.7
- sweetchuck/git-hooks: ^0.0
- sweetchuck/robo-git: ^0.2
- sweetchuck/robo-phpcs: ^0.1
- symfony/error-handler: ^5.0
- symfony/finder: ^4.0
- webmozart/path-util: ^2.3
This package is auto-updated.
Last update: 2024-12-18 14:15:31 UTC
README
Install
composer require --dev sweetchuck/robo-nvm
Task - taskNvmListLocal
<?php declare(strict_types = 1); class RoboFile extends \Robo\Tasks { use \Sweetchuck\Robo\Nvm\NvmTaskLoader; /** * @command nvm:list-local */ public function nvmListLocal() { return $this ->collectionBuilder() ->addTask($this->taskNvmListLocal()) ->addCode(function (\Robo\State\Data $data): int { $output = $this->output(); $output->writeln(sprintf( 'Current node is: %s', $data['nvm.listLocal.current'], )); $output->writeln('Available NodeJS versions:'); foreach ($data['nvm.listLocal.versions'] as $value) { $output->writeln(" $value"); } return 0; }); } }
Run: vendor/bin/robo nvm:list-local
Current node is: v9.3.0 v9.3.0 v11.5.0 v15.0.1
Task - taskNvmWhich
<?php declare(strict_types = 1); class RoboFile extends \Robo\Tasks { use \Sweetchuck\Robo\Nvm\NvmTaskLoader; /** * @command nvm:which */ public function nvmWhich() { return $this ->collectionBuilder() ->addTask($this->taskNvmWhich()) ->addCode(function (\Robo\State\Data $data): int { $output = $this->output(); $output->writeln(sprintf( 'nvm.which.nodeExecutable = %s', $data['nvm.which.nodeExecutable'], )); $output->writeln(sprintf( 'nvm.which.binDir = %s', $data['nvm.which.binDir'], )); return 0; }); } }
Run: vendor/bin/robo nvm:which
nvm.which.nodeExecutable = /home/me/.nvm/versions/node/v9.3.0/bin/node nvm.which.binDir = /home/me/.nvm/versions/node/v9.3.0/bin