Skip to content

Commit 053d225

Browse files
ndeloofglours
authored andcommitted
append .exe to provider name doing executable lookup on windows
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
1 parent 93b597c commit 053d225

3 files changed

Lines changed: 47 additions & 1 deletion

File tree

pkg/compose/plugins.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func (s *composeService) getPluginBinaryPath(provider string) (path string, err
155155
path = plugin.Path
156156
}
157157
if manager.IsNotFound(err) {
158-
path, err = exec.LookPath(provider)
158+
path, err = exec.LookPath(executable(provider))
159159
}
160160
return path, err
161161
}

pkg/compose/plugins_windows.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//go:build windows
2+
3+
/*
4+
Copyright 2020 Docker Compose CLI authors
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
*/
18+
19+
package compose
20+
21+
func executable(s string) string {
22+
return s + ".exe"
23+
}

pkg/compose/suffix_unix.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//go:build !windows
2+
3+
/*
4+
Copyright 2020 Docker Compose CLI authors
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
*/
18+
19+
package compose
20+
21+
func executable(s string) string {
22+
return s
23+
}

0 commit comments

Comments
 (0)