Skip to content

Commit

Permalink
fix(builders): Don't fail on non-fatal missing binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
elldritch committed Mar 20, 2018
1 parent 91944c9 commit 70fc3a5
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions builders/bower.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ func (builder *BowerBuilder) Initialize() error {
// Set Node context variables
nodeCmd, nodeVersion, err := which("-v", os.Getenv("NODE_BINARY"), "node", "nodejs")
if err != nil {
return fmt.Errorf("could not find Node binary (try setting $NODE_BINARY): %s", err.Error())
bowerLogger.Warningf("Could not find Node binary (try setting $NODE_BINARY): %s", err.Error())
}
builder.NodeCmd = nodeCmd
builder.NodeVersion = nodeVersion

// Set Bower context variables
bowerCmd, bowerVersion, err := which("-v", os.Getenv("BOWER_BINARY"), "bower")
if err != nil {
return fmt.Errorf("could not find Bower binary (try setting $BOWER_BINARY): %s", err.Error())
bowerLogger.Warningf("Could not find Bower binary (try setting $BOWER_BINARY): %s", err.Error())
}
builder.BowerCmd = bowerCmd
builder.BowerVersion = bowerVersion
Expand Down
2 changes: 1 addition & 1 deletion builders/composer.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (builder *ComposerBuilder) Initialize() error {
// Set PHP context variables
phpCmd, phpVersion, err := which("-v", os.Getenv("PHP_BINARY"), "php")
if err != nil {
return fmt.Errorf("could not find PHP binary (try setting $PHP_BINARY): %s", err.Error())
composerLogger.Warningf("Could not find PHP binary (try setting $PHP_BINARY): %s", err.Error())
}
builder.PHPCmd = phpCmd
builder.PHPVersion = phpVersion
Expand Down
2 changes: 1 addition & 1 deletion builders/golang.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (builder *GoBuilder) Initialize() error {
builder.VndrVersion = ""

if depErr != nil && glideErr != nil && godepErr != nil && govendorErr != nil && vndrErr != nil {
return fmt.Errorf("no supported Go build tools detected (try setting $DEP_BINARY or $GLIDE_BINARY or $GODEP_BINARY or $GOVENDOR_BINARY or $VNDR_BINARY): %#v %#v %#v %#v %#v", depErr, glideErr, godepErr, govendorErr, vndrErr)
goLogger.Warningf("No supported Go build tools detected (try setting $DEP_BINARY or $GLIDE_BINARY or $GODEP_BINARY or $GOVENDOR_BINARY or $VNDR_BINARY): %#v %#v %#v %#v %#v", depErr, glideErr, godepErr, govendorErr, vndrErr)
}

goLogger.Debugf("Done initializing Go builder: %#v", builder)
Expand Down
2 changes: 1 addition & 1 deletion builders/maven.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (builder *MavenBuilder) Initialize() error {
// Set Java context variables
javaCmd, javaVersion, err := which("-version", os.Getenv("JAVA_BINARY"), "java")
if err != nil {
return fmt.Errorf("could not find Java binary (try setting $JAVA_BINARY): %s", err.Error())
mavenLogger.Warningf("Could not find Java binary (try setting $JAVA_BINARY): %s", err.Error())
}
builder.JavaCmd = javaCmd
builder.JavaVersion = javaVersion
Expand Down
4 changes: 2 additions & 2 deletions builders/nodejs.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (builder *NodeJSBuilder) Initialize() error {
// Set NodeJS context variables
nodeCmd, nodeVersion, err := which("-v", os.Getenv("NODE_BINARY"), "node", "nodejs")
if err != nil {
return fmt.Errorf("could not find Node binary (try setting $NODE_BINARY): %s", err.Error())
nodejsLogger.Warningf("Could not find Node binary (try setting $NODE_BINARY): %s", err.Error())
}
builder.NodeCmd = nodeCmd
builder.NodeVersion = nodeVersion
Expand All @@ -73,7 +73,7 @@ func (builder *NodeJSBuilder) Initialize() error {
builder.YarnVersion = yarnVersion

if npmErr != nil && yarnErr != nil {
return fmt.Errorf("no supported Nodejs build tools detected (try setting $NPM_BINARY or $YARN_BINARY): %#v %#v", npmErr, yarnErr)
nodejsLogger.Warningf("No supported Nodejs build tools detected (try setting $NPM_BINARY or $YARN_BINARY): %#v %#v", npmErr, yarnErr)
}

nodejsLogger.Debugf("Initialized Nodejs builder: %#v", builder)
Expand Down
4 changes: 2 additions & 2 deletions builders/ruby.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ func (builder *RubyBuilder) Initialize() error {
// Set Ruby context variables
rubyCmd, rubyVersion, err := which("-v", os.Getenv("RUBY_BINARY"), "ruby")
if err != nil {
return fmt.Errorf("could not find Ruby binary (try setting $RUBY_BINARY): %s", err.Error())
rubyLogger.Warningf("Could not find Ruby binary (try setting $RUBY_BINARY): %s", err.Error())
}
builder.RubyCmd = rubyCmd
builder.RubyVersion = rubyVersion

// Set Gem context variables
gemCmd, gemVersion, err := which("-v", os.Getenv("GEM_BINARY"), "gem")
if err != nil {
return fmt.Errorf("could not find Gem binary (try setting $GEM_BINARY): %s", err.Error())
rubyLogger.Warningf("Could not find Gem binary (try setting $GEM_BINARY): %s", err.Error())
}
builder.GemCmd = gemCmd
builder.GemVersion = gemVersion
Expand Down
2 changes: 1 addition & 1 deletion builders/sbt.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (builder *SBTBuilder) Initialize() error {
// Set Java context variables
javaCmd, javaVersion, err := which("-version", os.Getenv("JAVA_BINARY"), "java")
if err != nil {
return fmt.Errorf("could not find Java binary (try setting $JAVA_BINARY): %s", err.Error())
sbtLogger.Warningf("Could not find Java binary (try setting $JAVA_BINARY): %s", err.Error())
}
builder.JavaCmd = javaCmd
builder.JavaVersion = javaVersion
Expand Down

0 comments on commit 70fc3a5

Please sign in to comment.