@@ -10,8 +10,7 @@ import (
1010 "path/filepath"
1111 "strings"
1212
13- "github.com/docker/app/internal/constants"
14- "github.com/docker/app/internal/utils"
13+ "github.com/docker/app/internal"
1514 "github.com/pkg/errors"
1615)
1716
@@ -25,7 +24,7 @@ func findApp() (string, error) {
2524 if err != nil {
2625 return "" , errors .Wrap (err , "cannot resolve current working directory" )
2726 }
28- if strings .HasSuffix (cwd , constants .AppExtension ) {
27+ if strings .HasSuffix (cwd , internal .AppExtension ) {
2928 return cwd , nil
3029 }
3130 content , err := ioutil .ReadDir (cwd )
@@ -34,7 +33,7 @@ func findApp() (string, error) {
3433 }
3534 hit := ""
3635 for _ , c := range content {
37- if strings .HasSuffix (c .Name (), constants .AppExtension ) {
36+ if strings .HasSuffix (c .Name (), internal .AppExtension ) {
3837 if hit != "" {
3938 return "" , fmt .Errorf ("multiple applications found in current directory, specify the application name on the command line" )
4039 }
@@ -53,15 +52,15 @@ func extractImage(appname string) (string, func(), error) {
5352 if strings .Contains (appname , ":" ) {
5453 nametag := strings .Split (appname , ":" )
5554 if len (nametag ) == 3 || strings .Contains (nametag [1 ], "/" ) {
56- nametag [1 ] = utils .DirNameFromAppName (nametag [1 ])
55+ nametag [1 ] = internal .DirNameFromAppName (nametag [1 ])
5756 appname = filepath .Base (nametag [1 ])
5857 } else {
59- nametag [0 ] = utils .DirNameFromAppName (nametag [0 ])
58+ nametag [0 ] = internal .DirNameFromAppName (nametag [0 ])
6059 appname = filepath .Base (nametag [0 ])
6160 }
6261 imagename = strings .Join (nametag , ":" )
6362 } else {
64- imagename = utils .DirNameFromAppName (appname )
63+ imagename = internal .DirNameFromAppName (appname )
6564 appname = filepath .Base (imagename )
6665 }
6766 tempDir , err := ioutil .TempDir ("" , "dockerapp" )
@@ -109,7 +108,7 @@ func Extract(appname string) (string, func(), error) {
109108 s , err := os .Stat (appname )
110109 if err != nil {
111110 // try appending our extension
112- appname = utils .DirNameFromAppName (appname )
111+ appname = internal .DirNameFromAppName (appname )
113112 s , err = os .Stat (appname )
114113 }
115114 if err != nil {
0 commit comments