grim/convey

Parents 48f6379f7d7f
Children 8c7af5e9a4cc
Properly handle export path's when we have an explicit destination
--- a/docker/export.go Mon Feb 19 15:34:29 2018 -0600
+++ b/docker/export.go Mon Feb 19 17:04:15 2018 -0600
@@ -55,11 +55,6 @@
// build out the source path
source := workSpace + ":" + filepath.Join("/workspace", src)
- // if we have an explict path we but the file directly in that directory
- if e.Path != "" {
- dest = filepath.Join(e.Path, filepath.Base(dest))
- }
-
cmdv := []string{
"cp",
source,
@@ -90,7 +85,12 @@
continue
}
- err = e.file(name, workSpace, match, tasks.DestFromSrc(match), st)
+ dest := e.Path
+ if dest == "" {
+ dest = tasks.DestFromSrc(match)
+ }
+
+ err = e.file(name, workSpace, match, dest, st)
if err != nil {
return err
}
@@ -127,6 +127,10 @@
} else {
src, dest := tasks.ParseFilePath("", file)
+ if e.Path != "" {
+ dest = e.Path
+ }
+
// make sure the destination is in our build context
realDest, err := path.TraversesNonExistent(st.CfgPath, dest)
if err != nil {