-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dev: initialize submodules in dev doctor
#75746
dev: initialize submodules in dev doctor
#75746
Conversation
ed05c22
to
c88409c
Compare
pkg/cmd/dev/doctor.go
Outdated
if _, err = d.exec.CommandContextSilent(ctx, "git", "submodule", "update", "--init", "--recursive"); err != nil { | ||
return err | ||
} | ||
if _, err = d.exec.CommandContextSilent(ctx, "mkdir", "-p", binDir); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: You can use d.os.MkdirAll(binDir)
instead of shelling out to mkdir
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
pkg/cmd/dev/doctor.go
Outdated
if _, err = d.exec.CommandContextSilent(ctx, "mkdir", "-p", binDir); err != nil { | ||
return err | ||
} | ||
if _, err = d.exec.CommandContextSilent(ctx, "touch", submodulesMarkerPath); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: You can use d.os.writeFile(submodulesMarkerPath, "")
instead of shelling out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
This commit adds a check to `dev doctor` to initialize submodules, like we do in our `Makefile`. Release note: None
c88409c
to
8504245
Compare
TFTR bors r+ |
Build succeeded: |
This commit adds a check to
dev doctor
to initialize submodules, like we doin our
Makefile
.Fixes #72247
Release note: None