1 #!/usr/bin/env nix-shell
2 #! nix-shell -i bash -p common-updater-scripts fd jq
6 latest_release
="$(curl --silent 'https://api.github.com/repos/hyprwm/Hyprland/releases/latest')"
7 latest_tag
="$(curl --silent 'https://api.github.com/repos/hyprwm/Hyprland/tags?per_page=1')"
8 commit_hash
="$(jq -r '.[0].commit.sha' <<<"$latest_tag")"
9 latest_commit
="$(curl --silent 'https://api.github.com/repos/hyprwm/Hyprland/commits/'"$commit_hash"'')"
10 commit_message
="$(jq -r '.commit.message' <<<"$latest_commit")"
12 tag
=$
(jq
-r '.tag_name' <<<"$latest_release")
16 branch
=$
(jq
-r '.target_commitish' <<<"$latest_release")
18 date=$
(jq
-r '.created_at' <<<"$latest_release")
22 # update version; otherwise fail
23 update-source-version hyprland
"$version" --ignore-same-hash
26 files
="$(fd --full-path /hyprland/ | head -1)"
30 "branch": "'"$branch"'",
31 "commit_hash": "'"$commit_hash"'",
32 "commit_message": "'"$commit_message"'",