diff options
author | Benjamin Staffin <ben@folsomlabs.com> | 2015-03-17 15:00:16 -0700 |
---|---|---|
committer | Benjamin Staffin <ben@folsomlabs.com> | 2015-03-17 15:00:16 -0700 |
commit | 1b1f26636ed2cb65c4e8baba41c1534cda3c83c1 (patch) | |
tree | c1bc293bd8ccf0ffd499c69f469323d6b5c3ebab /pkgs/development/web | |
parent | f7f0fd0dfe439fc8dbfebc106788ba6ce35e46c9 (diff) | |
download | nixlib-1b1f26636ed2cb65c4e8baba41c1534cda3c83c1.tar nixlib-1b1f26636ed2cb65c4e8baba41c1534cda3c83c1.tar.gz nixlib-1b1f26636ed2cb65c4e8baba41c1534cda3c83c1.tar.bz2 nixlib-1b1f26636ed2cb65c4e8baba41c1534cda3c83c1.tar.lz nixlib-1b1f26636ed2cb65c4e8baba41c1534cda3c83c1.tar.xz nixlib-1b1f26636ed2cb65c4e8baba41c1534cda3c83c1.tar.zst nixlib-1b1f26636ed2cb65c4e8baba41c1534cda3c83c1.zip |
iojs: Fix update-iojs script
The nix-instantiate invocations only work correctly if this script is run from the root directory of nixpkgs, or in a directory without a default.nix file and NIX_PATH set appropriately.
Diffstat (limited to 'pkgs/development/web')
-rwxr-xr-x | pkgs/development/web/iojs/update-iojs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pkgs/development/web/iojs/update-iojs b/pkgs/development/web/iojs/update-iojs index e0e073a0ff9b..3140c5e842b4 100755 --- a/pkgs/development/web/iojs/update-iojs +++ b/pkgs/development/web/iojs/update-iojs @@ -1,10 +1,12 @@ -#!/bin/sh -e +#!/bin/sh # # Fetch the latest io.js release (stable/nightly) and update # `default.nix` in this directory. # -cd "$(dirname "$0")" +set -e + +HERE="$(dirname "$0")" latest() { curl -s "$1" | grep 'href="v' \ @@ -39,11 +41,11 @@ nightly=$(latest_log nightly 'https://iojs.org/download/nightly/') sed -i \ "/version = if nightly/s/then.*/then \"$nightly\" else \"$stable\";/" \ - default.nix + "$HERE/default.nix" stableHash=$(hash_log "$(url iojs.src)") nightlyHash=$(hash_log "$(url iojs-nightly.src)") sed -i \ "/sha256 = if nightly/{N;s/\"[^\"]*\"/\"$nightlyHash\"/;N;s/\"[^\"]*\";/\"$stableHash\";/}" \ - default.nix + "$HERE/default.nix" |