diff --git a/get-modified-packages/get-modified-packages.sh b/get-modified-packages/get-modified-packages.sh index f0d8d266..4d627055 100755 --- a/get-modified-packages/get-modified-packages.sh +++ b/get-modified-packages/get-modified-packages.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Search for packages that have been modified from the base ref. -# Usage: get-modified-packages.sh +# Search for packages that have been modified from the base branch. +# Usage: get-modified-packages.sh set -e @@ -15,11 +15,12 @@ while [ "${1-}" != "" ]; do shift done -base_ref="${args[0]}" +# example: base_branch="origin/main" +base_branch="${args[0]}" # Check args -if [ "$base_ref" = "" ]; then - echo -e "\e[31mPlease input a valid base_ref as the 1st argument.\e[m" +if [ "$base_branch" = "" ]; then + echo -e "\e[31mPlease input a valid base_branch as the 1st argument.\e[m" exit 1 fi @@ -49,8 +50,8 @@ function find_package_dir() { return 1 } -# Find modified files from base ref -modified_files=$(git diff --name-only "$base_ref"...HEAD) +# Find modified files from base branch +modified_files=$(git diff --name-only "$base_branch"...HEAD) # Find modified packages modified_package_dirs=()