Skip to content

Commit

Permalink
fix(get-modified-packages): fix a bug with top-level project reposito…
Browse files Browse the repository at this point in the history
…ries (#61)

* fix: get-modified-packages.sh with less diff

Signed-off-by: h-ohta <[email protected]>

* apply review

Signed-off-by: Kenji Miyake <[email protected]>

Co-authored-by: Kenji Miyake <[email protected]>
  • Loading branch information
h-ohta and Kenji Miyake authored Feb 7, 2022
1 parent 349f213 commit e7a38ea
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions get-modified-packages/get-modified-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ function find_package_dir() {

target_dir=$(dirname "$1")
while true; do
parent_dir=$(dirname "$target_dir")

# Exit if no parent found
if [ "$parent_dir" = "$target_dir" ]; then
return 0
fi

# Output package name if package.xml found
if [ -f "$target_dir/package.xml" ]; then
if [ ! -f "$target_dir/COLCON_IGNORE" ]; then
Expand All @@ -43,6 +36,12 @@ function find_package_dir() {
fi
fi

# Exit if no parent found
parent_dir=$(dirname "$target_dir")
if [ "$parent_dir" = "$target_dir" ]; then
return 0
fi

# Move to parent dir
target_dir=$parent_dir
done
Expand Down

0 comments on commit e7a38ea

Please sign in to comment.