Skip to content

Commit

Permalink
Updated get-changed-paths.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 committed Nov 24, 2022
1 parent 0951b64 commit bf3ca40
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions get-changed-paths.sh
Expand Up @@ -25,7 +25,7 @@ if [[ -n $INPUT_DIFF_RELATIVE ]]; then
fi

function get_dirname_max_depth() {
local dir="$@"
local dir="$1"

local dirs=()
IFS='/' read -ra dirs <<< "$dir"
Expand Down Expand Up @@ -81,7 +81,7 @@ function get_diff() {
done < <(git submodule | awk '{print $2}')

if [[ "$INPUT_DIR_NAMES" == "true" ]]; then
git diff --diff-filter="$filter" --name-only --ignore-submodules=all "$base$DIFF$sha" | xargs -I {} dirname {} | uniq | get_dirname_max_depth | uniq && exit_status=$? || exit_status=$?
git diff --diff-filter="$filter" --name-only --ignore-submodules=all "$base$DIFF$sha" | xargs -I {} dirname {} | uniq | xargs get_dirname_max_depth | uniq && exit_status=$? || exit_status=$?

if [[ $exit_status -ne 0 ]]; then
echo "::error::Failed to get changed directories between: $base$DIFF$sha"
Expand Down Expand Up @@ -125,7 +125,7 @@ function get_renames() {
done < <(git submodule | awk '{print $2}')

if [[ "$INPUT_DIR_NAMES" == "true" ]]; then
git log --name-status --ignore-submodules=all "$base" "$sha" | { grep -E "^R" || true; } | awk -F '\t' -v d="$INPUT_OLD_NEW_SEPARATOR" '{print $2d$3}' | xargs -I {} dirname {} | uniq | get_dirname_max_depth | uniq && exit_status=$? || exit_status=$?
git log --name-status --ignore-submodules=all "$base" "$sha" | { grep -E "^R" || true; } | awk -F '\t' -v d="$INPUT_OLD_NEW_SEPARATOR" '{print $2d$3}' | xargs -I {} dirname {} | uniq | xargs get_dirname_max_depth | uniq && exit_status=$? || exit_status=$?

if [[ $exit_status -ne 0 ]]; then
echo "::error::Failed to get renamed directories between: $base$sha"
Expand Down

0 comments on commit bf3ca40

Please sign in to comment.