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
drone
drone-build
drone-bot

View file

@ -128,17 +128,6 @@ func createClone(c *Context) error {
return err
}
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
}

View file

@ -3,6 +3,7 @@ package main
import (
"encoding/base64"
"fmt"
"path/filepath"
"github.com/drone/drone/common"
"github.com/drone/drone/parser"
@ -48,6 +49,17 @@ func setup(c *Context) error {
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
}