@@ -59,17 +59,18 @@ func (j Jam) Execute(buildpackDir, output, version string, offline bool) error {
59
59
60
60
extensionTomlPath := filepath .Join (buildpackDir , "extension.toml" )
61
61
62
- buildpackOrExtensionToml := "buildpack.toml"
63
- command := "--buildpack"
62
+ var buildpackType string
64
63
65
64
if fileExists , err := fs .Exists (extensionTomlPath ); fileExists && err == nil {
66
- buildpackOrExtensionToml = "extension.toml"
67
- command = "--extension"
65
+ buildpackType = "extension"
66
+ } else {
67
+ buildpackType = "buildpack"
68
68
}
69
69
70
70
args := []string {
71
71
"pack" ,
72
- command , filepath .Join (buildpackDir , buildpackOrExtensionToml ),
72
+ fmt .Sprintf ("--%s" , buildpackType ),
73
+ filepath .Join (buildpackDir , fmt .Sprintf ("%s.toml" , buildpackType )),
73
74
"--output" , buildpackTarballPath ,
74
75
"--version" , version ,
75
76
}
@@ -106,21 +107,11 @@ func (j Jam) Execute(buildpackDir, output, version string, offline bool) error {
106
107
107
108
}
108
109
109
- if ( command == "--buildpack" ) {
110
- args = []string {
111
- "buildpack" , "package" ,
112
- output ,
113
- "--format" , "file" ,
114
- "--target" , fmt .Sprintf ("linux/%s" , runtime .GOARCH ),
115
- }
116
- } else {
117
- // pack extension does not yet support multi-arch
118
- // update to inclue --target once it does
119
- args = []string {
120
- "extension" , "package" ,
121
- output ,
122
- "--format" , "file" ,
123
- }
110
+ args = []string {
111
+ buildpackType , "package" ,
112
+ output ,
113
+ "--format" , "file" ,
114
+ "--target" , fmt .Sprintf ("linux/%s" , runtime .GOARCH ),
124
115
}
125
116
126
117
err = j .pack .Execute (pexec.Execution {
0 commit comments