Skip to content

Commit

Permalink
Handle version with ldflags. Remove old CI scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
brikis98 committed Jun 20, 2016
1 parent b929ad7 commit 45c095d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 243 deletions.
194 changes: 0 additions & 194 deletions _ci/build-and-push-release-assets.sh

This file was deleted.

7 changes: 0 additions & 7 deletions _ci/cross-compile.sh

This file was deleted.

23 changes: 0 additions & 23 deletions _ci/run-tests.sh

This file was deleted.

15 changes: 5 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import (
"path"
)

// This variable is set at build time using -ldflags parameters. For more info, see:
// http://stackoverflow.com/a/11355611/483528
var VERSION string

type FetchOptions struct {
RepoUrl string
CommitSha string
Expand All @@ -34,7 +38,7 @@ func main() {
app.Name = "fetch"
app.Usage = "fetch makes it easy to download files, folders, and release assets from a specific git commit, branch, or tag of public and private GitHub repos."
app.UsageText = "fetch [global options] <local-download-path>\n (See https://github.com/gruntwork-io/fetch for examples, argument definitions, and additional docs.)"
app.Version = getVersion(Version, VersionPrerelease)
app.Version = VERSION

app.Flags = []cli.Flag{
cli.StringFlag{
Expand Down Expand Up @@ -275,15 +279,6 @@ func cleanupZipFile(localZipFilePath string) error {
return nil
}

// getVersion returns a properly formatted version string
func getVersion(version string, versionPreRelease string) string {
if versionPreRelease != "" {
return version
} else {
return fmt.Sprintf("%s-%s", version, versionPreRelease)
}
}

func getErrorMessage(errorCode int, errorDetails string) string {
switch errorCode {
case INVALID_TAG_CONSTRAINT_EXPRESSION:
Expand Down
9 changes: 0 additions & 9 deletions version.go

This file was deleted.

0 comments on commit 45c095d

Please sign in to comment.