summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorVictor Zagorodny <vzagorodny@gitlab.com>2019-09-02 13:58:34 +0000
committerDouwe Maan <douwe@gitlab.com>2019-09-02 13:58:34 +0000
commit26351d380c3fc9bd3e5b20d5e5fcc90f4cf5c102 (patch)
tree2a2b4e4a8cd16e27dba9a1702d0f3a2addd030fd /bin
parent754e11b7188865cf16aae0a9f27d9b16f208f601 (diff)
downloadgitlab-shell-26351d380c3fc9bd3e5b20d5e5fcc90f4cf5c102.tar.gz
Refactor "go build" path constants
Diffstat (limited to 'bin')
-rwxr-xr-xbin/compile9
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/compile b/bin/compile
index 229b8fd..e6eacca 100755
--- a/bin/compile
+++ b/bin/compile
@@ -5,13 +5,16 @@ require 'fileutils'
require_relative '../support/go_build'
include GoBuild
+BUILD_BIN_GLOB = File.join(BUILD_DIR, 'bin', '*')
+ROOT_BIN = File.join(ROOT_PATH, 'bin')
+
def main
ensure_build_dir_exists
- run!(GO_ENV, %W[go install ./cmd/...], chdir: File.join(ROOT_PATH, GO_DIR))
- executables = Dir[File.join(BUILD_DIR, 'bin', '*')]
+ run!(GO_ENV, %W[go install ./cmd/...], chdir: GO_DIR)
+ executables = Dir[BUILD_BIN_GLOB]
FileUtils.chmod(0755, executables)
- FileUtils.cp(executables, File.join(ROOT_PATH, 'bin'))
+ FileUtils.cp(executables, ROOT_BIN)
end
main