Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
No specific case for windows, always resolve binary name before execu…
Browse files Browse the repository at this point in the history
…ting command

Signed-off-by: Guillaume Tardif <[email protected]>
  • Loading branch information
gtardif committed Nov 5, 2020
1 parent 41a1553 commit 66a1263
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion cli/mobycli/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (

"github.com/spf13/cobra"

"github.com/docker/compose-cli/cli/mobycli/resolvepath"
apicontext "github.com/docker/compose-cli/context"
"github.com/docker/compose-cli/context/store"
"github.com/docker/compose-cli/metrics"
Expand Down Expand Up @@ -60,7 +61,7 @@ func mustDelegateToMoby(ctxType string) bool {

// Exec delegates to com.docker.cli if on moby context
func Exec(root *cobra.Command) {
execBinary, err := LookPath(ComDockerCli)
execBinary, err := resolvepath.LookPath(ComDockerCli)
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
limitations under the License.
*/

package mobycli
package resolvepath

import (
"os/exec"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package mobycli
package resolvepath

import (
"errors"
Expand Down
2 changes: 1 addition & 1 deletion scripts/validate/fileheader
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ fi

BASEPATH="${1-}"

ltag -t "${BASEPATH}scripts/validate/template" -excludes "validate testdata cli/mobycli/lp_windows.go" --check -v
ltag -t "${BASEPATH}scripts/validate/template" -excludes "validate testdata resolvepath" --check -v

0 comments on commit 66a1263

Please sign in to comment.