diff --git a/cmd_gen/main.go b/cmd_gen/main.go index 65fb9c7..63275dc 100644 --- a/cmd_gen/main.go +++ b/cmd_gen/main.go @@ -233,8 +233,8 @@ function run-dir() { echo $cmd "${options[@]}" "$@" > ${prefix}cmd status=0 $cmd "${options[@]}" "${script_options[@]}" "$@" &> ${prefix}pass || status=1 - cd "$outdir/oc" if [[ $status -eq "0" ]]; then + cd "$outdir/oc" go mod init &>> ${prefix}pass || status=1 go mod tidy &>> ${prefix}pass || status=1 goimports -w *.go &>> ${prefix}pass || status=1 diff --git a/cmd_gen/main_test.go b/cmd_gen/main_test.go index 4fee1c2..852d6b7 100644 --- a/cmd_gen/main_test.go +++ b/cmd_gen/main_test.go @@ -203,8 +203,8 @@ function run-dir() { echo $cmd "${options[@]}" "$@" > ${prefix}cmd status=0 $cmd "${options[@]}" "${script_options[@]}" "$@" &> ${prefix}pass || status=1 - cd "$outdir/oc" if [[ $status -eq "0" ]]; then + cd "$outdir/oc" go mod init &>> ${prefix}pass || status=1 go mod tidy &>> ${prefix}pass || status=1 goimports -w *.go &>> ${prefix}pass || status=1