18 lines
606 B
Bash
Executable File
18 lines
606 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -exou pipefail
|
|
|
|
DIRECTORY=$(realpath "$(dirname "$0")")
|
|
|
|
# Update swayimg
|
|
SWAYIMG_VERSION=$(curl https://api.github.com/repos/artemsen/swayimg/tags | jq -r ".[0].name" | tr -d "v")
|
|
SWAYIMG_URL="https://github.com/artemsen/swayimg/archive/refs/tags/v$SWAYIMG_VERSION.tar.gz"
|
|
SWAYIMG_HASH=$(nix-prefetch fetchurl --url "$SWAYIMG_URL")
|
|
jq --null-input \
|
|
--arg version "$SWAYIMG_VERSION" \
|
|
--arg url "$SWAYIMG_URL" \
|
|
--arg hash "$SWAYIMG_HASH" \
|
|
'{"version": $version, "url": $url, "hash": $hash}' \
|
|
> $DIRECTORY/swayimg.json
|
|
echo "swayimg now at $SWAYIMG_VERSION"
|