File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
set -eu
3
3
: " ${LIMA_INSTANCE:= default} "
4
+ : " ${LIMA_SHELL:= } "
5
+ : " ${LIMA_WORKDIR:= } "
4
6
: " ${LIMACTL:= limactl} "
5
7
6
8
if [ " $# " -eq 1 ]; then
@@ -11,11 +13,21 @@ if [ "$#" -eq 1 ]; then
11
13
echo " ${base} is an alias for \" ${LIMACTL} shell ${LIMA_INSTANCE} \" ."
12
14
echo " The instance name (\" ${LIMA_INSTANCE} \" ) can be changed by specifying \$ LIMA_INSTANCE."
13
15
echo
16
+ echo " The shell and initial workdir inside the instance can be specified via \$ LIMA_SHELL"
17
+ echo " and \$ LIMA_WORKDIR."
18
+ echo
14
19
echo " See \` ${LIMACTL} shell --help\` for further information."
15
20
exit 0
16
21
elif [ " $1 " = " -v" ] || [ " $1 " = " --version" ]; then
17
22
exec " $LIMACTL " " $@ "
18
23
fi
19
24
fi
20
25
21
- exec " $LIMACTL " shell " $LIMA_INSTANCE " " $@ "
26
+ set - " $LIMA_INSTANCE " " $@ "
27
+ if [ -n " ${LIMA_SHELL} " ]; then
28
+ set - --shell " $LIMA_SHELL " " $@ "
29
+ fi
30
+ if [ -n " ${LIMA_WORKDIR} " ]; then
31
+ set - --workdir " $LIMA_WORKDIR " " $@ "
32
+ fi
33
+ exec " $LIMACTL " shell " $@ "
Original file line number Diff line number Diff line change @@ -75,6 +75,12 @@ The directory contains the following files:
75
75
- ` $LIMA_INSTANCE ` : ` lima ... ` is expanded to ` limactl shell ${LIMA_INSTANCE} ... ` .
76
76
- Default : ` default `
77
77
78
+ - ` $LIMA_SHELL ` : ` lima ... ` is expanded to ` limactl shell --shell ${LIMA_SHELL} ... ` .
79
+ - No default : will use the user's shell configured inside the instance
80
+
81
+ - ` $LIMA_WORKDIR ` : ` lima ... ` is expanded to ` limactl shell --workdir ${LIMA_WORKDIR} ... ` .
82
+ - No default : will attempt to use the current directory from the host
83
+
78
84
- ` $QEMU_SYSTEM_X86_64 ` : path of ` qemu-system-x86_64 `
79
85
- Default: ` qemu-system-x86_64 ` in ` $PATH `
80
86
You can’t perform that action at this time.
0 commit comments