Skip to content

Commit

Permalink
Fix peek.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Feb 14, 2023
1 parent 7537133 commit be36c83
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions libexec/peek.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@
set -e

# sadly we seemingly need to reference origin/main
FOO="$(git diff --name-only origin/main --diff-filter=A) $(git ls-files . --exclude-standard --others)"
DIVERGENCE_SHA="$(git merge-base HEAD origin/main)"
CHANGED_FILES="$(git diff --name-only $DIVERGENCE_SHA)"

for x in $FOO; do
BAR=$(echo "$x" | sed -n 's#projects/\(.*\)/package\.yml$#\1#p')
if test -z "$BAR"
for CHANGED_FILE in $CHANGED_FILES; do
PROJECT=$(echo "$CHANGED_FILE" | sed -n 's#projects/\(.*\)/package\.yml$#\1#p')
if test -z "$PROJECT"
then
true # noop
elif test "$1" = "--print-paths"; then
echo "$x"
echo "$CHANGED_FILE"
else
echo "$BAR"
echo "$PROJECT"
fi
done

0 comments on commit be36c83

Please sign in to comment.