summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Wadley2016-03-11 19:31:20 +0000
committerTom Wadley2016-03-11 19:38:04 +0000
commitd0605619c8ef14e4a44fcb18a57d3b150b22f599 (patch)
treededd89f69aafdf3ab2a064dda554e1dbbc3cdda9
parent77f2b84918bd59fdff62dd8d017fbeb545f19a1e (diff)
downloadaur-d0605619c8ef14e4a44fcb18a57d3b150b22f599.tar.gz
Fix 'nvm exec' command by having init-nvm.sh create a script in NVM_DIR which passes through to the installed nvm-exec script
-rw-r--r--.SRCINFO8
-rw-r--r--PKGBUILD16
-rw-r--r--init-nvm.sh1
-rw-r--r--install-nvm-exec3
4 files changed, 21 insertions, 7 deletions
diff --git a/.SRCINFO b/.SRCINFO
index f688428daef..9f3670849c1 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,9 @@
# Generated by mksrcinfo v8
-# Mon Feb 15 18:22:28 UTC 2016
+# Fri Mar 11 19:37:13 UTC 2016
pkgbase = nvm
pkgdesc = Node Version Manager - Simple bash script to manage multiple active node.js versions
pkgver = 0.31.0
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/creationix/nvm
install = nvm.install
arch = any
@@ -11,8 +11,10 @@ pkgbase = nvm
optdepends = bash: bash completion
source = https://github.com/creationix/nvm/archive/v0.31.0.zip
source = init-nvm.sh
+ source = install-nvm-exec
md5sums = 1d07cc3d6d59233df3bff0ce044a9527
- md5sums = 359e7cff11f9053a1d380272591d29f3
+ md5sums = 1baa599ca9a724a42aff2bafb23a76ad
+ md5sums = 8f3c5b82f09636e9cf82d45d68c39cc6
pkgname = nvm
diff --git a/PKGBUILD b/PKGBUILD
index 2a30444e18f..9d49446a8be 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname=nvm
pkgver=0.31.0
-pkgrel=1
+pkgrel=2
pkgdesc="Node Version Manager - Simple bash script to manage multiple active node.js versions"
url="https://github.com/creationix/nvm"
arch=('any')
@@ -10,9 +10,11 @@ license=('MIT')
optdepends=('bash: bash completion')
install="${pkgname}.install"
source=("https://github.com/creationix/nvm/archive/v${pkgver}.zip"
- "init-nvm.sh")
+ "init-nvm.sh"
+ "install-nvm-exec")
md5sums=('1d07cc3d6d59233df3bff0ce044a9527'
- '359e7cff11f9053a1d380272591d29f3')
+ '1baa599ca9a724a42aff2bafb23a76ad'
+ '8f3c5b82f09636e9cf82d45d68c39cc6')
build() {
cd "${pkgname}-${pkgver}"
@@ -22,13 +24,19 @@ package() {
cd "${srcdir}"
# convenience script
- install -Dm644 init-nvm.sh "$pkgdir/usr/share/${pkgname}/init-nvm.sh"
+ install -Dm644 init-nvm.sh "$pkgdir/usr/share/$pkgname/init-nvm.sh"
+
+ # companion script which installs nvm-exec in NVM_DIR where upstream expects it
+ install -Dm644 install-nvm-exec "$pkgdir/usr/share/$pkgname/install-nvm-exec"
cd "${pkgname}-${pkgver}"
# nvm itself
install -Dm644 nvm.sh "$pkgdir/usr/share/$pkgname/nvm.sh"
+ # nvm-exec script for 'nvm exec' command
+ install -Dm755 nvm-exec "$pkgdir/usr/share/$pkgname/nvm-exec"
+
# bash completion
install -Dm644 bash_completion "$pkgdir/usr/share/$pkgname/bash_completion"
diff --git a/init-nvm.sh b/init-nvm.sh
index c1c5d9e9745..90da3964fdf 100644
--- a/init-nvm.sh
+++ b/init-nvm.sh
@@ -1,3 +1,4 @@
export NVM_DIR="$HOME/.nvm"
source /usr/share/nvm/nvm.sh
source /usr/share/nvm/bash_completion
+source /usr/share/nvm/install-nvm-exec
diff --git a/install-nvm-exec b/install-nvm-exec
new file mode 100644
index 00000000000..e9551f94fcb
--- /dev/null
+++ b/install-nvm-exec
@@ -0,0 +1,3 @@
+# Creates an nvm-exec script in NVM_DIR which passes through to the installed nvm-exec
+
+[ -e "$NVM_DIR/nvm-exec" ] || (mkdir -p "$NVM_DIR" && (echo '/usr/share/nvm/nvm-exec "$@"' > "$NVM_DIR/nvm-exec") && chmod +x "$NVM_DIR/nvm-exec")