Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit e3a9aed

Browse files
authored
Merge pull request #767 from zappy-shu/APP-345-validate-fails-trailing-slash
Clean path before validating app
2 parents d4e0845 + d1d0455 commit e3a9aed

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

internal/names.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func AppNameFromDir(dirName string) string {
9595
// DirNameFromAppName takes an application name and returns the
9696
// corresponding directory name
9797
func DirNameFromAppName(appName string) string {
98-
if strings.HasSuffix(strings.TrimSuffix(appName, "/"), AppExtension) {
98+
if strings.HasSuffix(filepath.Clean(appName), AppExtension) {
9999
return appName
100100
}
101101
return appName + AppExtension

internal/names_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ func TestDirNameFromAppName(t *testing.T) {
3737
{name: "", expected: ".dockerapp"},
3838
{name: "foo/bar", expected: "foo/bar.dockerapp"},
3939
{name: "foo/bar.dockerapp", expected: "foo/bar.dockerapp"},
40+
{name: "foo/bar.dockerapp/", expected: "foo/bar.dockerapp/"},
4041
// FIXME(vdemeester) we should fail here
4142
{name: "foo/bar/", expected: "foo/bar/.dockerapp"},
4243
{name: "/foo/bar.dockerapp", expected: "/foo/bar.dockerapp"},

0 commit comments

Comments
 (0)