You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Add `displayAlert()` for failure notifications so it doesn't disappear
- Add `displayNotification()` that uses the macOS Notification Manager
- Add check for `lima` in `$PATH`
- Add notifications to image pull operation
- Add notifications to VM start/stop
Signed-off-by: Joe Block <[email protected]>
@@ -75,6 +99,10 @@ function warnIfMissingDependencies() {
75
99
warnings=$(printf "${warnings}\njq is not in your PATH! - click for installation instructions | color=$STOPPED_VM_COLOR href=https://stedolan.github.io/jq/download/\n")
76
100
depsOK=0
77
101
fi
102
+
if! has lima;then
103
+
warnings=$(printf "${warnings}lima is not in your PATH! - click to get started | color=$STOPPED_VM_COLOR href=https://github.com/lima-vm/lima#getting-started\n")
104
+
depsOK=0
105
+
fi
78
106
if! has limactl;then
79
107
warnings=$(printf "${warnings}limactl is not in your PATH! - click to get started | color=$STOPPED_VM_COLOR href=https://github.com/lima-vm/lima#getting-started\n")
80
108
depsOK=0
@@ -166,7 +194,12 @@ function pullImage() {
166
194
if [[ "$VM"!='default' ]];then
167
195
export LIMA_INSTANCE="$VM"
168
196
fi
169
-
lima nerdctl image pull "$imageName"
197
+
displayNotification lima "Pulling ${imageName}..."
198
+
if lima nerdctl image pull "$imageName";then
199
+
displayNotification Lima "Pulled $imageName"
200
+
else
201
+
displayAlert Lima "Failed to pull $imageName"
202
+
fi
170
203
}
171
204
172
205
functionrmImage() {
@@ -194,12 +227,20 @@ function processMenuCommand() {
194
227
rmImage "$2""$3"# pull imagename vmname
195
228
;;
196
229
start)
197
-
logger -t 'limamenu'"Starting $2"
198
-
limactl start "$2"
230
+
displayNotification 'Lima'"Starting $2 VM"
231
+
if limactl start "$2";then
232
+
displayNotification "Lima""Started $2 VM successfully"
233
+
else
234
+
displayAlert "Lima""Failed to start $2 VM"
235
+
fi
199
236
;;
200
237
stop)
201
-
logger -t 'limamenu'"Stopping $2"
202
-
limactl stop "$2"
238
+
displayNotification 'Lima'"Stopping $2 VM"
239
+
if limactl stop "$2";then
240
+
displayNotification "Lima""Stopped $2 VM successfully"
0 commit comments