File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,10 @@ const (
33
33
)
34
34
35
35
func main () {
36
+ if os .Geteuid () == 0 && (len (os .Args ) < 2 || os .Args [1 ] != "generate-doc" ) {
37
+ panic ("must not run as the root user" )
38
+ }
39
+
36
40
yq .MaybeRunYQ ()
37
41
if runtime .GOOS == "windows" {
38
42
extras , hasExtra := os .LookupEnv ("_LIMA_WINDOWS_EXTRA_PATH" )
@@ -128,9 +132,6 @@ func newApp() *cobra.Command {
128
132
return errors .New ("limactl is running under rosetta, please reinstall lima with native arch" )
129
133
}
130
134
131
- if os .Geteuid () == 0 && cmd .Name () != "generate-doc" {
132
- return errors .New ("must not run as the root user" )
133
- }
134
135
// Make sure either $HOME or $LIMA_HOME is defined, so we don't need
135
136
// to check for errors later
136
137
dir , err := dirnames .LimaDir ()
You can’t perform that action at this time.
0 commit comments