Skip to content

Commit

Permalink
fix: remove tools bin when can not execute
Browse files Browse the repository at this point in the history
Signed-off-by: Yasunori Fujie <fujie@ai2-jp.com>
  • Loading branch information
yacchi committed Aug 27, 2021
1 parent 7b9c790 commit dd064d9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ go_plugin_tool() {
# tools.go <command> [arguments]
(
cd "${current_script_dir}"

# remove binary if can not execute
if [[ -f "tools" ]] && ! ./tools version &>/dev/null; then
rm ./tools
fi

if [[ ! -f "tools" || "tools.go" -nt "tools" ]]; then
go_cmd build -o ./tools tools.go
fi
Expand Down

0 comments on commit dd064d9

Please sign in to comment.