From 26351d380c3fc9bd3e5b20d5e5fcc90f4cf5c102 Mon Sep 17 00:00:00 2001 From: Victor Zagorodny Date: Mon, 2 Sep 2019 13:58:34 +0000 Subject: Refactor "go build" path constants --- bin/compile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'bin') 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 -- cgit v1.2.1