Commit 135be5ba authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

Merge branch 'fix-application-build' into 'master'

fix: resolve build mode based on package main appearance

See merge request to-be-continuous/golang!46
parents 3f7c6c3c b08bf371
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -151,12 +151,12 @@ stages:
  }

  function go_build_auto() {
    log_info "auto build mode, looking up for a \\e[33;1mmain.go\\e[0m file..."
    found_main_go=$(find ./ -name 'main.go' | wc -l)
    if [ "${found_main_go}" -eq 0 ]; then
      go_build_modules
    else
    log_info "auto build mode, looking up for a \\e[33;1mmain\\e[0m package..."
    if grep -Rw --include "*.go" "^package main"
    then
      go_build_application
    else
      go_build_modules
    fi
  }