-
Notifications
You must be signed in to change notification settings - Fork 619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add LIMA_SHELL env var to lima command #780
Conversation
@@ -1,6 +1,7 @@ | |||
#!/bin/sh | |||
set -eu | |||
: "${LIMA_INSTANCE:=default}" | |||
: "${LIMA_SHELL:=}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering rather we should have a generic way to support limactl shell
options in the lima
script. Perhaps like LIMA_SHELL_ARGS=--workdir=/ --shell=/bin/zsh
. But on the second thought maybe users should just set alias lima=limactl shell ....
.
Originally posted by @AkihiroSuda in #779 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should have a generic way to support
limactl shell
options in thelima
script
Practically speaking, we only have 2 options: --shell
and --workdir
, and I don't really expect somebody to hard-code the workdir for each lima
call. But even then, I would rather add another LIMA_WORKDIR
variable instead, so the options can be manipulated independent of each other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we only have 2 options
Eventually we will have more
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but I still like having individual variables. This is how I would do it:
set - "$LIMA_INSTANCE" "$@"
if [ -n "${LIMA_SHELL}" ]; then
set - --shell "$LIMA_SHELL" "$@"
fi
if [ -n "${LIMA_WORKDIR}" ]; then
set - --workdir "$LIMA_WORKDIR" "$@"
fi
exec "$LIMACTL" shell "$@"
This is trivially extensible to additional settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the PR to include support for LIMA_WORKDIR
as well (and rebased on top of master
, so the --shell
option is actually functional.
To override the default shell configured inside the instance. Signed-off-by: Jan Dubois <[email protected]>
CI failing
https://github.com/lima-vm/lima/runs/5864063545?check_suite_focus=true |
Seems like CI flakiness; it passed on re-run. |
Split off from #779.