mirror of
https://github.com/wentasah/ros2nix.git
synced 2025-06-09 15:52:23 +03:00
Move rosdistro updating to a separate script
... and fix bugs
This commit is contained in:
parent
ee76acc9c9
commit
527b8460e5
2 changed files with 28 additions and 23 deletions
26
maint/rosdistro-update.sh
Executable file
26
maint/rosdistro-update.sh
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
pr_body=${1:-/tmp/.body}
|
||||
|
||||
nix build .#rosdistro --out-link /tmp/rosdistro-old
|
||||
nix flake update rosdistro
|
||||
nix build .#rosdistro --out-link /tmp/rosdistro-new
|
||||
grep -Rh nixos: /tmp/rosdistro-old > /tmp/rosdistro-old.txt
|
||||
grep -Rh nixos: /tmp/rosdistro-new > /tmp/rosdistro-new.txt
|
||||
git reset --hard
|
||||
if ! git diff -U0 /tmp/rosdistro-old.txt /tmp/rosdistro-new.txt > /tmp/rosdistro-diff; then
|
||||
# redo update with nice commit message
|
||||
nix flake update rosdistro --commit-lock-file
|
||||
GIT_EDITOR='sed -i -e "1crosdistro update"' git commit --amend
|
||||
GIT_EDITOR='sed -i -e "\$r/tmp/rosdistro-diff"' git commit --amend
|
||||
cat <<EOF > "$pr_body"
|
||||
Diff:
|
||||
\`\`\`diff
|
||||
$(cat /tmp/rosdistro-diff)
|
||||
\`\`\`
|
||||
EOF
|
||||
else
|
||||
echo "No relevant changes"
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue