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 (
3333)
3434
3535func 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+
3640 yq .MaybeRunYQ ()
3741 if runtime .GOOS == "windows" {
3842 extras , hasExtra := os .LookupEnv ("_LIMA_WINDOWS_EXTRA_PATH" )
@@ -128,9 +132,6 @@ func newApp() *cobra.Command {
128132 return errors .New ("limactl is running under rosetta, please reinstall lima with native arch" )
129133 }
130134
131- if os .Geteuid () == 0 && cmd .Name () != "generate-doc" {
132- return errors .New ("must not run as the root user" )
133- }
134135 // Make sure either $HOME or $LIMA_HOME is defined, so we don't need
135136 // to check for errors later
136137 dir , err := dirnames .LimaDir ()
You can’t perform that action at this time.
0 commit comments