Skip to content

Suggestion: use limactl list --json #4

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

Closed
AkihiroSuda opened this issue Sep 17, 2021 · 1 comment · Fixed by #5
Closed

Suggestion: use limactl list --json #4

AkihiroSuda opened this issue Sep 17, 2021 · 1 comment · Fixed by #5

Comments

@AkihiroSuda
Copy link

First, thanks a lot for working on this

for limavm in $(limactl list | grep -v 'NAME STATUS SSH ARCH DIR' | awk '{ print $1 }')

The grep above doesn't seem robust, and will probably break soon with a future version of Lima.
I'd suggest using limactl list --json and use jq for parsing JSON.

$ limactl list --json  | jq .
{
  "name": "default",
  "status": "Running",
  "dir": "/Users/suda/.lima/default",
  "arch": "x86_64",
  "sshLocalPort": 60022,
  "hostAgentPID": 1968,
  "qemuPID": 1972
}
@unixorn
Copy link
Owner

unixorn commented Sep 18, 2021

Thanks for the tip, I'll update accordingly, then work on lima-vm/lima#253

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants