devboxExecutable returns the path to the Devbox launcher script or the current binary if the launcher is unavailable.
()
| 373 | // devboxExecutable returns the path to the Devbox launcher script or the |
| 374 | // current binary if the launcher is unavailable. |
| 375 | func devboxExecutable() (string, error) { |
| 376 | if exe := os.Getenv(envir.LauncherPath); exe != "" { |
| 377 | if abs, err := filepath.Abs(exe); err == nil { |
| 378 | return abs, nil |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | exe, err := os.Executable() |
| 383 | if err != nil { |
| 384 | return "", redact.Errorf("get path to devbox executable: %v", err) |
| 385 | } |
| 386 | return exe, nil |
| 387 | } |
| 388 | |
| 389 | func isSudo(key string) bool { |
| 390 | // DEVBOX_SUDO_TASK is set when a task relaunched Devbox by calling |