biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / development / tools / misc / dart-sass / update.sh
blob595349e1387c2e6266754f67cbbd02812a1cbe34
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p yq ripgrep common-updater-scripts dart
4 set -xeu -o pipefail
6 PACKAGE_DIR="$(realpath "$(dirname "$0")")"
7 cd "$PACKAGE_DIR/.."
8 while ! test -f default.nix; do cd .. ; done
9 NIXPKGS_DIR="$PWD"
11 dart_sass_version="$(
12 list-git-tags --url=https://github.com/sass/dart-sass \
13 | rg '^\d' \
14 | sort --version-sort \
15 | tail -n1
18 embedded_protocol_version="$(
19 list-git-tags --url=https://github.com/sass/sass \
20 | rg '^embedded-protocol-(.*)' -r '$1' \
21 | sort --version-sort \
22 | tail -n1
25 cd "$NIXPKGS_DIR"
26 update-source-version dart-sass "$dart_sass_version"
27 update-source-version dart-sass "$embedded_protocol_version" \
28 --version-key=embedded-protocol-version \
29 --source-key=embedded-protocol
31 TMPDIR="$(mktemp -d)"
32 cd "$TMPDIR"
34 src="$(nix-build --no-link "$NIXPKGS_DIR" -A dart-sass.src)"
35 cp $src/pubspec.* .
37 # Maybe one day upstream will ship a pubspec.lock,
38 # until then we must generate a fresh one
39 if ! test -f pubspec.lock; then
40 dart pub update
43 yq . pubspec.lock > "$PACKAGE_DIR/pubspec.lock.json"
45 rm -rf "$TMPDIR"