Add support for dest = '.' and additional DestinationFilepath test
This commit is contained in:
parent
b3ec877b60
commit
cc0c672697
|
|
@ -80,7 +80,7 @@ func matchSources(srcs, files []string) ([]string, error) {
|
|||
}
|
||||
|
||||
func IsDestDir(path string) bool {
|
||||
return strings.HasSuffix(path, "/")
|
||||
return strings.HasSuffix(path, "/") || path == "."
|
||||
}
|
||||
|
||||
// DestinationFilepath returns the destination filepath from the build context to the image filesystem
|
||||
|
|
|
|||
|
|
@ -109,6 +109,13 @@ var destinationFilepathTests = []struct {
|
|||
dest: "/dir",
|
||||
expectedFilepath: "/dir/context/bar",
|
||||
},
|
||||
{
|
||||
srcName: "context/foo",
|
||||
filename: "context/foo",
|
||||
cwd: "/test",
|
||||
dest: ".",
|
||||
expectedFilepath: "/test/foo",
|
||||
},
|
||||
}
|
||||
|
||||
func Test_DestinationFilepath(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue