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')