From 7e7fe357a87dc2e7100964cf80263e8065ecb7df Mon Sep 17 00:00:00 2001 From: Max Howell Date: Sat, 18 Feb 2023 08:26:40 -0500 Subject: [PATCH] Fix not getting untracked files --- bin/pkg-status | 1 + libexec/peek.sh | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 120000 bin/pkg-status diff --git a/bin/pkg-status b/bin/pkg-status new file mode 120000 index 00000000..6b85d3a0 --- /dev/null +++ b/bin/pkg-status @@ -0,0 +1 @@ +../libexec/peek.sh \ No newline at end of file diff --git a/libexec/peek.sh b/libexec/peek.sh index 2b3297bd..075d19d4 100755 --- a/libexec/peek.sh +++ b/libexec/peek.sh @@ -9,8 +9,8 @@ set -e -if ! d=$(git rev-parse --show-toplevel 2>/dev/null); then - echo "tea.xyz/brewkit: error: cwd is not a git repo" >&2 +if ! d="$(git rev-parse --show-toplevel 2>/dev/null)"; then + echo "tea.xyz/brewkit: error: cwd is not inside a git repo" >&2 exit 1 fi @@ -21,7 +21,7 @@ fi # sadly we seemingly need to reference origin/main DIVERGENCE_SHA="$(git merge-base HEAD origin/main)" -CHANGED_FILES="$(git diff --name-only "$DIVERGENCE_SHA")" +CHANGED_FILES="$(git diff --name-only "$DIVERGENCE_SHA") $(git status --untracked-files)" for CHANGED_FILE in $CHANGED_FILES; do PROJECT=$(echo "$CHANGED_FILE" | sed -n 's#projects/\(.*\)/package\.yml$#\1#p')