Skip to content

Commit a6edee0

Browse files
committed
Add lima wrapper for windows without bash
Advanced users would like to install a "msys" environment with bash, but for casual lima usage this should be enough. Signed-off-by: Anders F Björklund <[email protected]>
1 parent e0852c9 commit a6edee0

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ PLANTUML ?= plantuml # may also be "java -jar plantuml.jar" if installed elsewhe
88

99
GOOS ?= $(shell $(GO) env GOOS)
1010
ifeq ($(GOOS),windows)
11+
bat = .bat
1112
exe = .exe
1213
endif
1314

@@ -26,6 +27,7 @@ exe: _output/bin/limactl$(exe)
2627
.PHONY: binaries
2728
binaries: clean \
2829
_output/bin/lima \
30+
_output/bin/lima$(bat) \
2931
_output/bin/limactl$(exe) \
3032
_output/bin/nerdctl.lima \
3133
_output/bin/docker.lima \
@@ -48,6 +50,11 @@ _output/bin/lima:
4850
mkdir -p _output/bin
4951
cp -a ./cmd/lima $@
5052

53+
.PHONY: _output/bin/lima.bat
54+
_output/bin/lima.bat:
55+
mkdir -p _output/bin
56+
cp -a ./cmd/lima.bat $@
57+
5158
.PHONY: _output/bin/nerdctl.lima
5259
_output/bin/nerdctl.lima:
5360
mkdir -p _output/bin
@@ -99,6 +106,7 @@ uninstall:
99106
@test -f "$(DEST)/bin/lima" || echo "lima not found in $(DEST) prefix"
100107
rm -rf \
101108
"$(DEST)/bin/lima" \
109+
"$(DEST)/bin/lima$(bat)" \
102110
"$(DEST)/bin/limactl$(exe)" \
103111
"$(DEST)/bin/nerdctl.lima" \
104112
"$(DEST)/bin/docker.lima" \

cmd/lima.bat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@echo off
2+
IF NOT DEFINED LIMACTL (SET LIMACTL=limactl)
3+
IF NOT DEFINED LIMA_INSTANCE (SET LIMA_INSTANCE=default)
4+
%LIMACTL% shell %LIMA_INSTANCE% %*

0 commit comments

Comments
 (0)