3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2025-03-05 21:06:25 +00:00

chore: switch sed for awk (#401)

* chore: switch sed for awk

* Update entrypoint.sh

* Update entrypoint.sh
This commit is contained in:
Tonye Jack 2022-02-26 04:37:27 -05:00 committed by GitHub
parent af93c64cfb
commit ed90466495
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,13 +7,13 @@ function get_diff() {
sha="$2"
filter="$3"
while IFS='' read -r sub; do
sub_commit_pre="$(git diff "$base" "$sha" -- "$sub" | grep '^[-]Subproject commit' | sed 's/[-]Subproject commit //')"
sub_commit_cur="$(git diff "$base" "$sha" -- "$sub" | grep '^[+]Subproject commit' | sed 's/[+]Subproject commit //')"
sub_commit_pre="$(git diff "$base" "$sha" -- "$sub" | grep '^[-]Subproject commit' | awk '{print $3}')"
sub_commit_cur="$(git diff "$base" "$sha" -- "$sub" | grep '^[+]Subproject commit' | awk '{print $3}')"
if [ -n "$sub_commit_cur" ]; then
(
cd "$sub" && (
# the strange magic number is a hardcoded "empty tree" commit sha
get_diff "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" "$filter" | sed "s#^#$sub/#"
get_diff "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" "$filter" | awk -v r="$sub" '{ print "" r "/" $0}'
)
)
fi