nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 30 lines 956 B view raw
1#!/usr/bin/env nix-shell 2#!nix-shell -i bash -p common-updater-scripts coreutils gnused prefetch-yarn-deps 3 4set -e 5 6# update src version and hash 7version="$(list-git-tags | sort -V | tail -1 | sed 's|server-||')" 8 9update-source-version awk-language-server "$version" 10 11# update vendored yarn.lock & package.json 12newSrc="$(nix-build --no-out-link -A awk-language-server.src)" 13 14nixFile="$(nix-instantiate --eval --strict -A 'awk-language-server.meta.position' \ 15 | sed -re 's/^"(.*):[0-9]+"$/\1/')" 16 17nixFileDir="$(dirname "$nixFile")" 18 19cp --force --no-preserve=mode "$newSrc"/{yarn.lock,package.json} "$nixFileDir/" 20 21# update offlineCache hash 22oldCacheSriHash="$(nix-instantiate --eval --strict \ 23 -A 'awk-language-server.offlineCache.drvAttrs.outputHash')" 24 25newCacheHash="$(prefetch-yarn-deps "$nixFileDir/yarn.lock")" 26 27newCacheSriHash="$(nix-hash --to-sri --type sha256 "$newCacheHash")" 28 29sed -i "s|$oldCacheSriHash|\"$newCacheSriHash\"|" "$nixFile" 30