Skip to content

Commit

Permalink
update-vendor-hash: make it directory independent
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 authored and mergify[bot] committed Aug 13, 2023
1 parent 2f955d6 commit 29e05d9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions script/update-vendor-hash
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

set -exuo pipefail

failedbuild=$(nix build --impure --expr 'import ./. { vendorHash = ""; }' 2>&1 || true)
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

failedbuild=$(nix build --impure --expr "import $SCRIPT_DIR/.. { vendorHash = ""; }" 2>&1 || true)
echo "$failedbuild"
checksum=$(echo "$failedbuild" | awk '/got:.*sha256/ { print $2 }')
sed -i -e "s|vendorHash ? \".*\"|vendorHash ? \"$checksum\"|" default.nix
sed -i -e "s|vendorHash ? \".*\"|vendorHash ? \"$checksum\"|" $SCRIPT_DIR/../default.nix

0 comments on commit 29e05d9

Please sign in to comment.