2 Star 7 Fork 7

Bomy / docker

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
dispatchers_unix.go 683 Bytes
一键复制 编辑 原始数据 按行查看 历史
John Howard 提交于 2016-05-03 13:56 . Builder default shell
// +build !windows
package dockerfile
import (
"fmt"
"os"
"path/filepath"
)
// normaliseWorkdir normalises a user requested working directory in a
// platform sematically consistent way.
func normaliseWorkdir(current string, requested string) (string, error) {
if requested == "" {
return "", fmt.Errorf("cannot normalise nothing")
}
current = filepath.FromSlash(current)
requested = filepath.FromSlash(requested)
if !filepath.IsAbs(requested) {
return filepath.Join(string(os.PathSeparator), current, requested), nil
}
return requested, nil
}
func errNotJSON(command, _ string) error {
return fmt.Errorf("%s requires the arguments to be in JSON form", command)
}
1
https://gitee.com/Bomy/docker.git
git@gitee.com:Bomy/docker.git
Bomy
docker
docker
v1.13.1

搜索帮助