File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22# -*- coding: utf-8 -*-
33
44export ZSH_DOCKER_PACKAGE_NAME=docker
5- export ZSH_DOCKER_CONTAINER_APP_NAME=" ${CONTAINER_APP_NAME :- podman } "
5+ export ZSH_DOCKER_CONTAINER_APP_NAME=" ${JASPER_CONTAINER_APP_NAME :- lima } "
66export ZSH_DOCKER_PODMAN_MACHINE_NAME=" podman-machine-default"
7+ export ZSH_DOCKER_LIMA_MACHINE_NAME=" default"
78export ZSH_DOCKER_MESSAGE_BREW=" Please install brew or use antibody bundle hadenlabs/zsh-brew"
89export ZSH_DOCKER_MESSAGE_YAY=" Please install Go or use antibody bundle hadenlabs/zsh-goenv"
910export ZSH_DOCKER_MESSAGE_RVM=" Please install rvm or use antibody bundle hadenlabs/zsh-rvm"
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env ksh
2+ # -*- coding: utf-8 -*-
3+
4+ function container::core {
5+ alias docker=' limactl shell default nerdctl'
6+ }
Original file line number Diff line number Diff line change @@ -16,7 +16,11 @@ function docker::config::main::factory {
1616 esac
1717
1818 case " ${ZSH_DOCKER_CONTAINER_APP_NAME} " in
19- podman* )
19+ lima* )
20+ # shellcheck source=/dev/null
21+ source " ${ZSH_DOCKER_PATH} " /config/lima.zsh
22+ ;;
23+ podman* )
2024 # shellcheck source=/dev/null
2125 source " ${ZSH_DOCKER_PATH} " /config/podman.zsh
2226 ;;
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env ksh
2+ # -*- coding: utf-8 -*-
3+
4+ function container::internal::container::install {
5+ if core::exists lima; then
6+ return
7+ fi
8+ message_info " Installing ${ZSH_DOCKER_PACKAGE_NAME} "
9+ core::install lima
10+ message_success " Installed ${ZSH_DOCKER_PACKAGE_NAME} "
11+ }
12+
13+ function container::internal::container::load {
14+ local machine_name=" ${ZSH_DOCKER_LIMA_MACHINE_NAME:- default} "
15+
16+ # Check if jq is installed
17+ if ! command -v jq > /dev/null 2>&1 ; then
18+ echo " ❌ 'jq' is required but not installed. Please install it with: brew install jq"
19+ return 1
20+ fi
21+
22+ # Check if the Lima machine exists
23+ if ! limactl list --json | jq -e --arg name " $machine_name " ' .[] | select(.name == $name)' > /dev/null; then
24+ echo " 🔧 Lima machine '${machine_name} ' does not exist. Initializing..."
25+ limactl start " $machine_name "
26+ return
27+ fi
28+
29+ # Check if the machine is running
30+ local running
31+ running=$( limactl list --json | jq -r --arg name " $machine_name " ' .[] | select(.name == $name) | .state' )
32+
33+ if [[ " $running " != " Running" ]]; then
34+ echo " 🚀 Lima machine '${machine_name} ' exists but is not running. Starting..."
35+ limactl start " $machine_name "
36+ else
37+ echo " ✅ Lima machine '${machine_name} ' is already running."
38+ fi
39+ }
Original file line number Diff line number Diff line change @@ -16,7 +16,11 @@ function docker::internal::main::factory {
1616 esac
1717
1818 case " ${ZSH_DOCKER_CONTAINER_APP_NAME} " in
19- podman* )
19+ lima* )
20+ # shellcheck source=/dev/null
21+ source " ${ZSH_DOCKER_PATH} " /internal/lima.zsh
22+ ;;
23+ podman* )
2024 # shellcheck source=/dev/null
2125 source " ${ZSH_DOCKER_PATH} " /internal/podman.zsh
2226 ;;
You can’t perform that action at this time.
0 commit comments