diff --git a/anda/tools/nvm/binscript b/anda/tools/nvm/binscript old mode 100644 new mode 100755 index fa7244c0af..c9e19105b0 --- a/anda/tools/nvm/binscript +++ b/anda/tools/nvm/binscript @@ -1,5 +1,5 @@ -#!/usr/bin/sh +#!/usr/bin/bash -. /etc/profile.d/nvm.sh +\. /etc/profile.d/nvm.sh --no-use nvm $@ diff --git a/anda/tools/nvm/nvm.spec b/anda/tools/nvm/nvm.spec index 4f36074d1f..847f097c51 100644 --- a/anda/tools/nvm/nvm.spec +++ b/anda/tools/nvm/nvm.spec @@ -1,6 +1,6 @@ Name: nvm Version: 0.40.3 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Node Version Manager License: MIT URL: https://github.com/nvm-sh/nvm @@ -9,7 +9,7 @@ Source1: binscript # Make sure NVM always chooses "$HOME/.nvm" as the directory for local files unless explicitly set otherwise Patch0: nvm-always-use-default-dir.patch # Only works with POSIX compliant shells -Requires: (bash or dash or ksh or zsh) +Requires: bash BuildArch: noarch Packager: Gilver E. @@ -26,6 +26,9 @@ POSIX-compliant script to manage multiple active Node.js versions. %install install -Dm755 %{SOURCE1} %{buildroot}%{_bindir}/%{name} + +# Give nvm-exec the correct search directory +sed -i 's|DIR=.*|DIR="%{_sysconfdir}/profile.d"|g' nvm-exec install -Dm755 nvm-exec -t %{buildroot}%{_bindir} install -Dm644 bash_completion %{buildroot}%{bash_completions_dir}/%{name}.bash