|
1 | 1 | #!/usr/bin/env nix-shell |
2 | | -#!nix-shell -i bash -p curl gnused jq nix-prefetch |
| 2 | +#!nix-shell -i bash -p common-updater-scripts gnused jq nix-prefetch |
3 | 3 | set -eou pipefail |
4 | 4 |
|
5 | 5 | ROOT="$(dirname "$(readlink -f "$0")")" |
6 | 6 |
|
7 | | -CURRENT_VERSION=$(nix-instantiate --eval --strict --json -A tailwindcss.version . | jq -r .) |
8 | | -LATEST_VERSION=$(curl --fail --silent https://api.github.com/repos/tailwindlabs/tailwindcss/releases/latest | jq --raw-output .tag_name | sed 's/v//') |
9 | | -sed -i "s/version = \".*\"/version = \"${LATEST_VERSION}\"/" "$ROOT/default.nix" |
| 7 | +CURRENT_VERSION=$(nix-instantiate --eval --strict --json -A tailwindcss_3.version . | jq -r .) |
| 8 | +LATEST_VERSION=$(list-git-tags --url=https://github.com/tailwindlabs/tailwindcss | rg 'v3[0-9\.]*$' | sed -e 's/^v//' | sort -V | tail -n 1) |
| 9 | +sed -i "s/version = \".*\"/version = \"${LATEST_VERSION}\"/" "$ROOT/package.nix" |
10 | 10 |
|
11 | 11 | if [ "$CURRENT_VERSION" = "$LATEST_VERSION" ]; then |
12 | | - echo "tailwindcss already at latest version $CURRENT_VERSION, exiting" |
| 12 | + echo "tailwindcss_3 already at latest version $CURRENT_VERSION, exiting" |
13 | 13 | exit 0 |
14 | 14 | fi |
15 | 15 |
|
16 | 16 | function updatePlatform() { |
17 | 17 | NIXPLAT=$1 |
18 | 18 | TAILWINDPLAT=$2 |
19 | | - echo "Updating tailwindcss for $NIXPLAT" |
| 19 | + echo "Updating tailwindcss_3 for $NIXPLAT" |
20 | 20 |
|
21 | 21 | URL="https://github.com/tailwindlabs/tailwindcss/releases/download/v${LATEST_VERSION}/tailwindcss-${TAILWINDPLAT}" |
22 | 22 | HASH=$(nix hash to-sri --type sha256 "$(nix-prefetch-url --type sha256 "$URL")") |
23 | 23 |
|
24 | | - sed -i "s,$NIXPLAT = \"sha256.*\",$NIXPLAT = \"${HASH}\"," "$ROOT/default.nix" |
| 24 | + sed -i "s,$NIXPLAT = \"sha256.*\",$NIXPLAT = \"${HASH}\"," "$ROOT/package.nix" |
25 | 25 | } |
26 | 26 |
|
27 | 27 | updatePlatform aarch64-darwin macos-arm64 |
|
0 commit comments