mirror of
https://github.com/drone/drone-cli.git
synced 2024-09-28 15:01:16 +02:00
fix drone exec on windows with docker toolbox
This commit is contained in:
parent
a785895ab0
commit
ecedcd0608
@ -7,6 +7,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -327,6 +328,15 @@ func exec(c *cli.Context) error {
|
|||||||
workspacePath = c.String("workspace-path")
|
workspacePath = c.String("workspace-path")
|
||||||
}
|
}
|
||||||
dir, _ := filepath.Abs(filepath.Dir(file))
|
dir, _ := filepath.Abs(filepath.Dir(file))
|
||||||
|
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
base := filepath.VolumeName(dir)
|
||||||
|
if len(base) == 2 {
|
||||||
|
dir = dir[2:]
|
||||||
|
base = strings.ToLower(base[:1])
|
||||||
|
dir = "/" + base + filepath.ToSlash(dir)
|
||||||
|
}
|
||||||
|
}
|
||||||
volumes = append(volumes, c.String("prefix")+"_default:"+workspaceBase)
|
volumes = append(volumes, c.String("prefix")+"_default:"+workspaceBase)
|
||||||
volumes = append(volumes, dir+":"+path.Join(workspaceBase, workspacePath))
|
volumes = append(volumes, dir+":"+path.Join(workspaceBase, workspacePath))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user