mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-27 13:57:10 +03:00
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.
This commit is contained in:
parent
f7f0fd0dfe
commit
1b1f26636e
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user