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 dir
="pkgs/by-name/hy/hyprland"
29 "branch": "'"$branch"'",
30 "commit_hash": "'"$commit_hash"'",
31 "commit_message": "'"$commit_message"'",
34 }' >"$dir/info.json" ||
echo "Please run the script in the root of the Nixpkgs repo"