Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Acme Downloader
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Geant DevOps
Acme Downloader
Commits
bf8c09bd
Unverified
Commit
bf8c09bd
authored
3 years ago
by
Massimiliano Adamo
Browse files
Options
Downloads
Patches
Plain Diff
add usage instructions
parent
30138c04
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
build.sh
+6
-3
6 additions, 3 deletions
build.sh
with
6 additions
and
3 deletions
build.sh
+
6
−
3
View file @
bf8c09bd
#!/bin/bash
#!/bin/bash
#
#
# for windows and Mac check the README
# you can choose your OS and Architecture as follows:
# ./build.sh --os=windows --arch=amd64
#
# or you can use --help to check a list of platforms and options
#
#
if
!
which go &>/dev/null
;
then
if
!
which go &>/dev/null
;
then
echo
"Go is not installed or is not in
\$
PATH"
echo
"Go is not installed or is not in
\$
PATH"
echo
"giving up..."
echo
"giving up..."
exit
exit
1
fi
fi
unset
GOBIN
unset
GOBIN
BIN_NAME
=
acme-downloader
BIN_NAME
=
acme-downloader
...
@@ -86,7 +89,7 @@ if [[ "$OS" == "windows" ]]; then
...
@@ -86,7 +89,7 @@ if [[ "$OS" == "windows" ]]; then
BIN_NAME
=
"
${
BIN_NAME
}
.exe"
BIN_NAME
=
"
${
BIN_NAME
}
.exe"
fi
fi
# env GOOS=
windows
GOARCH=
amd64
go build -ldflags "-s -w -X main.appVersion=${PROG_VERSION} -X main.buildTime=${BUILDTIME}" .
# env GOOS=
$OS
GOARCH=
$ARCH
go build -ldflags "-s -w -X main.appVersion=${PROG_VERSION} -X main.buildTime=${BUILDTIME}" .
env
GOOS
=
$OS
GOARCH
=
$ARCH
go get
-ldflags
"-s -w -X main.appVersion=
${
PROG_VERSION
}
-X main.buildTime=
${
BUILDTIME
}
"
.
env
GOOS
=
$OS
GOARCH
=
$ARCH
go get
-ldflags
"-s -w -X main.appVersion=
${
PROG_VERSION
}
-X main.buildTime=
${
BUILDTIME
}
"
.
if
[
$?
-gt
0
]
;
then
if
[
$?
-gt
0
]
;
then
echo
-e
"
\n
there was an error while compiling the code
\n
"
echo
-e
"
\n
there was an error while compiling the code
\n
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment