Skip to content

Commit

Permalink
build: fix a bunch of bugs in build script
Browse files Browse the repository at this point in the history
  • Loading branch information
codesenberg committed Oct 15, 2020
1 parent f04c7b4 commit ba2c55f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions build.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import argparse
import os
import subprocess

platforms = [
("darwin", "amd64"),
("darwin", "arm64"),
("freebsd", "386"),
("freebsd", "amd64"),
("freebsd", "arm"),
Expand All @@ -29,9 +29,12 @@
type=str, help="string used as a version when building binaries")
args = parser.parse_args()
version = args.version
for (os, arch) in platforms:
for (build_os, build_arch) in platforms:
ext = ""
if os == "windows":
if build_os == "windows":
ext = ".exe"
build_env = os.environ.copy()
build_env["GOOS"] = build_os
build_env["GOARCH"] = build_arch
subprocess.run(["go", "build", "-ldflags", "-X main.version=%s" %
version, "-o", "bombardier-%s-%s%s" % (os, arch, ext)])
version, "-o", "bombardier-%s-%s%s" % (build_os, build_arch, ext)], env=build_env)

0 comments on commit ba2c55f

Please sign in to comment.