From b64c1d036ffb9a4c4eaaea056e132775de62fc1d Mon Sep 17 00:00:00 2001 From: Antoine Cotten Date: Wed, 11 Sep 2024 11:22:21 +0200 Subject: [PATCH] tools: fix darwin-rebuild changelog The script returns early when $systemConfig is empty, which prevents the changelog from being displayed. --- pkgs/nix-tools/darwin-rebuild.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkgs/nix-tools/darwin-rebuild.sh b/pkgs/nix-tools/darwin-rebuild.sh index b88858d5..aa066865 100644 --- a/pkgs/nix-tools/darwin-rebuild.sh +++ b/pkgs/nix-tools/darwin-rebuild.sh @@ -203,7 +203,7 @@ if [ "$action" = edit ]; then fi fi -if [ "$action" = switch ] || [ "$action" = build ] || [ "$action" = check ]; then +if [ "$action" = switch ] || [ "$action" = build ] || [ "$action" = check ] || [ "$action" = changelog ]; then echo "building the system configuration..." >&2 if [ -z "$flake" ]; then systemConfig="$(nix-build '' "${extraBuildFlags[@]}" -A system)" @@ -252,11 +252,7 @@ if [ "$action" = switch ] || [ "$action" = activate ] || [ "$action" = rollback fi if [ "$action" = changelog ]; then - echo >&2 - echo "CHANGELOG" >&2 - echo >&2 - head -n 32 "$systemConfig/darwin-changes" - echo >&2 + ${PAGER:-less} -- "$systemConfig/darwin-changes" fi if [ "$action" = check ]; then