Skip to content

Commit

Permalink
fixed offline mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Nik Ogura committed Feb 10, 2019
1 parent e50d3b0 commit 7e8b0f8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
13 changes: 10 additions & 3 deletions cmd/dbt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
const DBT = "/usr/local/bin/dbt"

// VERSION the version of dbt. Must match version in metadata.json
const VERSION = "2.1.12"
const VERSION = "2.1.13"

// there are only two options for dbt itself, 'version' and 'offline'
var version string
Expand Down Expand Up @@ -67,9 +67,10 @@ func main() {
}

if len(args) > 0 {
possibles = []string{"-v", "-ov"}
versionPossibles := []string{"-v", "-ov"}
offlinePossibles := []string{"-o"}

if dbt.StringInSlice(args[0], possibles) {
if dbt.StringInSlice(args[0], versionPossibles) {
if len(args) > 2 {
version = args[1]

Expand All @@ -81,6 +82,12 @@ func main() {
} else {
log.Fatalf("-v flag requires a version.")
}

} else if dbt.StringInSlice(args[0], offlinePossibles) {
err = dbtObj.RunTool(version, args[1:], homedir, offline)
if err != nil {
log.Fatalf("Error running tool: %s", err)
}
} else {
err = dbtObj.RunTool(version, args, homedir, offline)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.1.12",
"version": "2.1.13",
"package": "github.com/nikogura/dbt",
"description": "Dynamic Binary Toolkit - A framework for running self-updating signed binaries from a central, trusted repository.",
"repository": "http://localhost:8081/artifactory/dbt",
Expand Down
2 changes: 1 addition & 1 deletion pkg/dbt/dbt.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func (dbt *DBT) FetchTrustStore(homedir string, verbose bool) (err error) {
return err
}

// IsCurrent returns whether the currently running version is the latest version, and possibly an error if the version check failes
// IsCurrent returns whether the currently running version is the latest version, and possibly an error if the version check fails
func (dbt *DBT) IsCurrent(binaryPath string) (ok bool, err error) {
if binaryPath == "" {
binaryPath = DbtBinaryPath
Expand Down

0 comments on commit 7e8b0f8

Please sign in to comment.