Skip to content

Commit

Permalink
Don't pass 'array' among functions, solving the space in path problem
Browse files Browse the repository at this point in the history
  • Loading branch information
chaodaiG committed Jun 26, 2020
1 parent 1dac0d7 commit b4fd479
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions prow/cmd/autobump/bump.sh
Expand Up @@ -68,7 +68,10 @@ main() {
fi
echo -e "Bumping: 'gcr.io/k8s-prow/' images to $(color-version "${new_version}") ..." >&2

bumpfiles=($(add_suffix "$(split_on_commas "$COMPONENT_FILE_DIR")"))
local IFS=,
local component_file_dir_array
read -ra component_file_dir_array <<< "${COMPONENT_FILE_DIR}"
bumpfiles=("${component_file_dir_array[@]/%/*.yaml}")
bumpfiles+=("${CONFIG_PATH}")
if [[ -n "${JOB_CONFIG_PATH}" ]]; then
bumpfiles+=($(grep -rl -e "gcr.io/k8s-prow/" "${JOB_CONFIG_PATH}"; true))
Expand Down Expand Up @@ -198,19 +201,6 @@ list() {
fi
}

split_on_commas() {
local IFS=,
local array
read -ra array <<< "$1"
echo "${array[@]}"
}

add_suffix() {
local array=($1)
local suffix="${2:-/*.yaml}"
echo "${array[@]/%/$suffix}"
}

# See https://misc.flogisoft.com/bash/tip_colors_and_formatting
color-image() { # Bold magenta
echo -e "\x1B[1;35m${*}\x1B[0m"
Expand Down

0 comments on commit b4fd479

Please sign in to comment.