mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-01 22:31:15 +00:00
fixed builder panic
This commit is contained in:
parent
b4add30df2
commit
ed0719c624
3 changed files with 14 additions and 11 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -18,3 +18,5 @@ drone.sublime-workspace
|
||||||
bindata.go
|
bindata.go
|
||||||
|
|
||||||
drone
|
drone
|
||||||
|
drone-build
|
||||||
|
drone-bot
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue