Skip to content

Commit 285bd8d

Browse files
committed
tailwindcss_[34]: split and fix updater scripts
1 parent 1ea38ae commit 285bd8d

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

pkgs/by-name/ta/tailwindcss_3/update.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
#!/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
33
set -eou pipefail
44

55
ROOT="$(dirname "$(readlink -f "$0")")"
66

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"
1010

1111
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"
1313
exit 0
1414
fi
1515

1616
function updatePlatform() {
1717
NIXPLAT=$1
1818
TAILWINDPLAT=$2
19-
echo "Updating tailwindcss for $NIXPLAT"
19+
echo "Updating tailwindcss_3 for $NIXPLAT"
2020

2121
URL="https://github.com/tailwindlabs/tailwindcss/releases/download/v${LATEST_VERSION}/tailwindcss-${TAILWINDPLAT}"
2222
HASH=$(nix hash to-sri --type sha256 "$(nix-prefetch-url --type sha256 "$URL")")
2323

24-
sed -i "s,$NIXPLAT = \"sha256.*\",$NIXPLAT = \"${HASH}\"," "$ROOT/default.nix"
24+
sed -i "s,$NIXPLAT = \"sha256.*\",$NIXPLAT = \"${HASH}\"," "$ROOT/package.nix"
2525
}
2626

2727
updatePlatform aarch64-darwin macos-arm64

pkgs/by-name/ta/tailwindcss_4/update.sh

100644100755
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
#!/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
33
set -eou pipefail
44

55
ROOT="$(dirname "$(readlink -f "$0")")"
66

77
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"
8+
LATEST_VERSION=$(list-git-tags --url=https://github.com/tailwindlabs/tailwindcss | rg 'v4[0-9\.]*$' | sed -e 's/^v//' | sort -V | tail -n 1)
9+
sed -i "s/version = \".*\"/version = \"${LATEST_VERSION}\"/" "$ROOT/package.nix"
1010

1111
if [ "$CURRENT_VERSION" = "$LATEST_VERSION" ]; then
12-
echo "tailwindcss already at latest version $CURRENT_VERSION, exiting"
12+
echo "tailwindcss_4 already at latest version $CURRENT_VERSION, exiting"
1313
exit 0
1414
fi
1515

1616
function updatePlatform() {
1717
NIXPLAT=$1
1818
TAILWINDPLAT=$2
19-
echo "Updating tailwindcss for $NIXPLAT"
19+
echo "Updating tailwindcss_4 for $NIXPLAT"
2020

2121
URL="https://github.com/tailwindlabs/tailwindcss/releases/download/v${LATEST_VERSION}/tailwindcss-${TAILWINDPLAT}"
2222
HASH=$(nix hash to-sri --type sha256 "$(nix-prefetch-url --type sha256 "$URL")")
2323

24-
sed -i "s,$NIXPLAT = \"sha256.*\",$NIXPLAT = \"${HASH}\"," "$ROOT/default.nix"
24+
sed -i "s,$NIXPLAT = \"sha256.*\",$NIXPLAT = \"${HASH}\"," "$ROOT/package.nix"
2525
}
2626

2727
updatePlatform aarch64-darwin macos-arm64

0 commit comments

Comments
 (0)