1
0
mirror of https://github.com/drone/drone-cli.git synced 2026-01-15 15:31:33 +01:00

fix drone exec on windows with docker toolbox

This commit is contained in:
Tobias Kunicke 2017-07-17 15:06:42 +02:00
parent a785895ab0
commit ecedcd0608

@ -7,6 +7,7 @@ import (
"os"
"path"
"path/filepath"
"runtime"
"strings"
"time"
@ -327,6 +328,15 @@ func exec(c *cli.Context) error {
workspacePath = c.String("workspace-path")
}
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, dir+":"+path.Join(workspaceBase, workspacePath))
}