Giter VIP home page Giter VIP logo

robo-nvm's Introduction

Robo task to run NVM related tasks

CircleCI codecov

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

robo-nvm's People

Contributors

dependabot[bot] avatar sweetchuck avatar

Watchers

 avatar  avatar  avatar

robo-nvm's Issues

nvm.sh file path detection

If the nvm is installed with brew install nvm on MacOS then the full path to the nvm.sh is /usr/local/opt/nvm/nvm.sh

Probably this method should be improved to detect the correct path.
\Sweetchuck\Robo\Nvm\Task\BaseCliTask::getDefaultNvmShFilePath

Couldn't install in Drupal codebase

Just testing. Didn't install with my Drupal setup.
Might not be your issue though. Feel free to close.

tho@chuck:~/htdocs/GzEvD/degov_nrw-project (master)$ COMPOSER_MEMORY_LIMIT=-1 composer require --dev sweetchuck/robo-nvm
Using version dev-master for sweetchuck/robo-nvm
./composer.json has been updated
Removing package drupal/simplify_menu so that it can be re-installed and re-patched.
  - Removing drupal/simplify_menu (2.0.0)
Deleting docroot/modules/contrib/simplify_menu - deleted
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - sweetchuck/robo-nvm dev-master requires sweetchuck/utils dev-master -> satisfiable by sweetchuck/utils[dev-master].
    - Installation request for sweetchuck/robo-nvm dev-master -> satisfiable by sweetchuck/robo-nvm[dev-master].
    - Conclusion: remove symfony/filesystem v3.4.29
    - Conclusion: don't install symfony/filesystem v3.4.29
    - sweetchuck/utils dev-master requires symfony/filesystem ^4.1 -> satisfiable by symfony/filesystem[4.1.x-dev, 4.2.x-dev, 4.3.x-dev, 4.4.x-dev, v4.1.0, v4.1.0-BETA1, v4.1.0-BETA2, v4.1.0-BETA3, v4.1.1, v4.1.10, v4.1.11, v4.1.12, v4.1.2, v4.1.3, v4.1.4, v4.1.5, v4.1.6, v4.1.7, v4.1.8, v4.1.9, v4.2.0, v4.2.0-BETA1, v4.2.0-BETA2, v4.2.0-RC1, v4.2.1, v4.2.10, v4.2.2, v4.2.3, v4.2.4, v4.2.5, v4.2.6, v4.2.7, v4.2.8, v4.2.9, v4.3.0, v4.3.0-BETA1, v4.3.0-BETA2, v4.3.0-RC1, v4.3.1, v4.3.2].
    - Can only install one of: symfony/filesystem[4.1.x-dev, v3.4.29].
    - Can only install one of: symfony/filesystem[4.2.x-dev, v3.4.29].
    - Can only install one of: symfony/filesystem[4.3.x-dev, v3.4.29].
    - Can only install one of: symfony/filesystem[4.4.x-dev, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.1.0, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.1.0-BETA1, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.1.0-BETA2, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.1.0-BETA3, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.1.1, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.1.10, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.1.11, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.1.12, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.1.2, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.1.3, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.1.4, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.1.5, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.1.6, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.1.7, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.1.8, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.1.9, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.2.0, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.2.0-BETA1, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.2.0-BETA2, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.2.0-RC1, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.2.1, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.2.10, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.2.2, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.2.3, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.2.4, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.2.5, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.2.6, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.2.7, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.2.8, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.2.9, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.3.0, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.3.0-BETA1, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.3.0-BETA2, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.3.0-RC1, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.3.1, v3.4.29].
    - Can only install one of: symfony/filesystem[v4.3.2, v3.4.29].
    - Installation request for symfony/filesystem (locked at v3.4.29) -> satisfiable by symfony/filesystem[v3.4.29].

tho@chuck:~/htdocs/GzEvD/degov_nrw-project (master)$ cat composer.json
{
  "name": "degov/nrwgov-project",
  "description": "Drupal 8 für die öffentliche Verwaltung in Nordrhein-Westfalen",
  "type": "project",
  "license": "GPL-3.0-or-later",
  "minimum-stability": "dev",
  "prefer-stable": true,
  "require": {
    "nrwgov/nrwgov": "~7.1.0",
    "php": ">=7.1",
    "platformsh/config-reader": "^2.1",
    "drupal/content_export_yaml": "^2.2"
  },
  "require-dev": {
    "drupal/drupal-extension": "^3.2",
    "behat/mink": "~1.7",
    "behat/mink-goutte-driver": "~1.2",
    "behat/behat": "^3.0"
  },
  "repositories": {
    "drupal": {
      "type": "composer",
      "url": "https://packages.drupal.org/8"
    },
    "bowser-assets": {
      "type": "composer",
      "url": "https://asset-packagist.org"
    },
    "nrwgov": {
      "type": "git",
      "url": "[email protected]:publicplan/nrwgov.git"
    },
    "degov-nrw-theme": {
      "type": "git",
      "url": "[email protected]:publicplan/degov_nrw_theme.git"
    },
    "dropzone": {
      "type": "package",
      "package": {
        "name": "enyo/dropzone",
        "version": "4.2.0",
        "type": "drupal-library",
        "source": {
          "url": "https://github.com/enyo/dropzone",
          "type": "git",
          "reference": "origin/master"
        }
      }
    },
    "servicekonto-nrw-library": {
     "type": "git",
     "url": "[email protected]:publicplan/servicekonto-nrw.git"
   },
    "shariff": {
      "type": "package",
      "package": {
        "name": "heiseonline/shariff",
        "version": "2.0.4",
        "type": "drupal-library",
        "dist": {
          "url": "https://github.com/heiseonline/shariff/releases/download/2.0.4/shariff-2.0.4.zip",
          "type": "zip"
        },
        "require": {
          "composer/installers": "^1.2.0"
        }
      }
    },
    "slick": {
      "type": "package",
      "package": {
        "name": "kenwheeler/slick",
        "version": "1.7.1",
        "type": "drupal-library",
        "source": {
          "type": "git",
          "url": "https://github.com/kenwheeler/slick",
          "reference": "master"
        }
      }
    },
    "doubletaptogo": {
      "type": "package",
      "package": {
        "name": "zenopopovici/doubletaptogo",
        "version": "0.3",
        "type": "drupal-library",
        "source": {
          "type": "git",
          "url": "https://bitbucket.org/publicplan/doubletaptogo.git",
          "reference": "master"
        }
      }
    },
    "leaflet": {
      "type": "package",
      "package": {
        "name": "leaflet/leaflet",
        "version": "1.1.0",
        "type": "drupal-library",
        "source": {
          "type": "git",
          "url": "https://github.com/Leaflet/Leaflet",
          "reference": "a3a7e04"
        }
      }
    },
    "jquery-hoverIntent": {
      "type": "package",
      "package": {
        "name": "briancherne/jquery-hoverIntent",
        "version": "1.8.1",
        "type": "drupal-library",
        "source": {
          "type": "git",
          "url": "https://github.com/briancherne/jquery-hoverIntent",
          "reference": "master"
        }
      }
    },
    "tika": {
      "type": "package",
      "package": {
        "name": "apache-tika",
        "version": "1.20",
        "type": "library",
        "dist": {
          "url": "https://archive.apache.org/dist/tika/tika-app-1.20.jar",
          "type": "file"
        },
        "require": {
          "composer/installers": "^1.2.0"
        }
      }
    }
  },
  "scripts": {
    "post-install-cmd": [
      "DrupalComposer\\DrupalScaffold\\Plugin::scaffold"
    ],
    "post-update-cmd": [
      "DrupalComposer\\DrupalScaffold\\Plugin::scaffold"
    ],
    "coder-check": [
      "./bin/phpcs --standard=vendor/drupal/coder/coder_sniffer/Drupal --colors --exclude=Drupal.Files.TxtFileLineLength"
    ],
    "coder-fix": [
      "./bin/phpcbf --standard=vendor/drupal/coder/coder_sniffer/Drupal --exclude=Drupal.Files.TxtFileLineLength"
    ]
  },
  "config": {
    "bin-dir": "bin/"
  },
  "extra": {
    "installer-paths": {
      "docroot/core": [
        "type:drupal-core"
      ],
      "docroot/modules/contrib/{$name}": [
        "type:drupal-module"
      ],
      "docroot/profiles/contrib/{$name}": [
        "type:drupal-profile"
      ],
      "docroot/themes/contrib/{$name}": [
        "type:drupal-theme"
      ],
      "drush/contrib/{$name}": [
        "type:drupal-drush"
      ],
      "docroot/libraries/{$name}": [
        "type:drupal-library"
      ],
      "docroot/themes/nrw/nrw_base_theme": [
        "degov/nrw_theme"
      ]
    },
    "enable-patching": true
  },
  "autoload-dev": {
    "psr-4": {
      "Drupal\\degov\\Behat\\Context\\": "docroot/profiles/contrib/degov/testing/behat/context/",
      "Drupal\\nrwgov\\Behat\\Context\\": "docroot/profiles/contrib/nrwgov/testing/behat/context/",
      "Drupal\\degov\\Behat\\Context\\Traits\\": "docroot/profiles/contrib/degov/testing/behat/context/Traits/",
      "Drupal\\Tests\\lightning_media\\": "docroot/profiles/contrib/degov/modules/lightning_media/tests/src",
      "nrwgov\\Scripts\\Robo\\": "docroot/profiles/contrib/nrwgov/scripts/robo",
      "degov\\Scripts\\Robo\\": "docroot/profiles/contrib/degov/scripts/robo"
    },
    "classmap": [
      "docroot/profiles/contrib/degov/modules/lightning_core/tests/contexts/AwaitTrait.inc"
    ]
  },
  "conflict": {
    "symfony/http-foundation": "3.4.24"
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.