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
This moves the bulk of the code into a separate package so that it can be
reused elsewhere. It returns the command without executing so that it can
be further customized by the caller.
Signed-off-by: Mark Yen <[email protected]>
// We can do an equals check here because we should only have received the status for VM 0
160
-
iflimaState=="Running" {
161
-
returntrue
162
-
}
163
-
iflimaState!="" {
164
-
fmt.Fprintf(os.Stderr,
165
-
"The Rancher Desktop VM needs to be in state \"Running\" in order to execute 'rdctl shell', but it is currently in state %q.\n%s.\n", limaState, restartDirective)
returnfmt.Errorf("the Rancher Desktop WSL distribution needs to be running in order to execute 'rdctl shell', but it currently is not.\n%s", restartDirective)
211
-
}
212
-
returnfmt.Errorf("the Rancher Desktop WSL distribution needs to be in state %q in order to execute 'rdctl shell', but it is currently in state %q.\n%s", desiredState, targetState, restartDirective)
// We can do an equals check here because we should only have received the status for VM 0
112
+
iflimaState=="Running" {
113
+
returntrue
114
+
}
115
+
iflimaState!="" {
116
+
fmt.Fprintf(os.Stderr,
117
+
"The Rancher Desktop VM needs to be in state \"Running\" in order to execute 'rdctl shell', but it is currently in state %q.\n%s.\n", limaState, restartDirective)
returnfmt.Errorf("the Rancher Desktop WSL distribution needs to be running in order to execute 'rdctl shell', but it currently is not.\n%s", restartDirective)
163
+
}
164
+
returnfmt.Errorf("the Rancher Desktop WSL distribution needs to be in state %q in order to execute 'rdctl shell', but it is currently in state %q.\n%s", desiredState, targetState, restartDirective)
0 commit comments