fixed builder panic

This commit is contained in:
Brad Rydzewski 2015-05-12 20:30:36 -07:00
parent b4add30df2
commit ed0719c624
3 changed files with 14 additions and 11 deletions

2
.gitignore vendored
View file

@ -18,3 +18,5 @@ drone.sublime-workspace
bindata.go bindata.go
drone drone
drone-build
drone-bot

View file

@ -128,17 +128,6 @@ func createClone(c *Context) error {
return err return err
} }
c.Clone.Dir = filepath.Join("/drone/src", url_.Host, c.Repo.FullName) c.Clone.Dir = filepath.Join("/drone/src", url_.Host, c.Repo.FullName)
// attempt to extract the clone path. i'm not a huge fan of
// this, by the way, but for now we'll keep it.
// TODO consider moving this to a transform?
pathv, ok := c.Conf.Clone.Config["path"]
if ok {
path, ok := pathv.(string)
if ok {
c.Clone.Dir = filepath.Join("/drone/src", path)
}
}
return nil return nil
} }

View file

@ -3,6 +3,7 @@ package main
import ( import (
"encoding/base64" "encoding/base64"
"fmt" "fmt"
"path/filepath"
"github.com/drone/drone/common" "github.com/drone/drone/common"
"github.com/drone/drone/parser" "github.com/drone/drone/parser"
@ -48,6 +49,17 @@ func setup(c *Context) error {
c.Conf.Build.Environment = append(c.Conf.Build.Environment, env) c.Conf.Build.Environment = append(c.Conf.Build.Environment, env)
} }
// attempt to extract the clone path. i'm not a huge fan of
// this, by the way, but for now we'll keep it.
// TODO consider moving this to a transform?
pathv, ok := c.Conf.Clone.Config["path"]
if ok {
path, ok := pathv.(string)
if ok {
c.Clone.Dir = filepath.Join("/drone/src", path)
}
}
return nil return nil
} }