add handling when source directory does not have slash suffix

This commit is contained in:
ohchang-kwon 2020-01-03 19:21:29 +09:00
parent 70270a65f0
commit fb4d1f9c8d
1 changed files with 4 additions and 1 deletions

View File

@ -59,12 +59,15 @@ func (c *CopyCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.Bu
if err != nil {
return err
}
if fi.IsDir() && !strings.HasSuffix(fullPath, string(os.PathSeparator)) {
fullPath += "/"
}
cwd := config.WorkingDir
if cwd == "" {
cwd = constants.RootDir
}
destPath, err := util.DestinationFilepath(src, dest, cwd)
destPath, err := util.DestinationFilepath(fullPath, dest, cwd)
if err != nil {
return err
}