Skip to content

Commit

Permalink
ci: support deps udpate
Browse files Browse the repository at this point in the history
Signed-off-by: thxCode <thxcode0824@gmail.com>
  • Loading branch information
thxCode committed Jan 15, 2024
1 parent aa4e6a2 commit cbaed8c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions hack/deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ source "${ROOT_DIR}/hack/lib/init.sh"

function mod() {
local path="$1"
shift 1

[[ "${path}" == "${ROOT_DIR}" ]] || pushd "${path}" >/dev/null 2>&1

if [[ -n "$*" ]] && [[ "$*" =~ update$ ]]; then
go get -u ./...
fi

go mod tidy
go mod download

Expand All @@ -24,15 +29,15 @@ function dispatch() {

shift 2
local specified_targets="$*"
if [[ -n ${specified_targets} ]] && [[ ! ${specified_targets} =~ ${target} ]]; then
if [[ -n ${specified_targets} ]] && [[ ${specified_targets} != "update" ]] && [[ ! ${specified_targets} =~ ${target} ]]; then
return
fi

seal::log::debug "modding ${target}"
if [[ "${PARALLELIZE:-true}" == "false" ]]; then
mod "${path}"
mod "${path}" "$@"
else
mod "${path}" &
mod "${path}" "$@" &
fi
}

Expand Down

0 comments on commit cbaed8c

Please sign in to comment.