feat: gen plugin automatically initializes submodules after cloning the template repo#88
feat: gen plugin automatically initializes submodules after cloning the template repo#88mhmd-azeez merged 2 commits intomainfrom
Conversation
|
It seems ok -- since that new "delete the .git repo if a parent one exists" code runs after this process: // ...
// initialize submodules if any
if _, err := os.Stat(filepath.Join(dir, ".gitmodules")); err == nil {
if err := runCmdInDir(dir, "git", "submodule", "update", "--init", "--recursive"); err != nil {
return err
}
}
absDir, err := filepath.Abs(dir)
if err != nil {
return err
}
if hasGitRepoInParents(absDir, 100) { // <--- this should take care of any cleanup we'd want
if err := os.RemoveAll(filepath.Join(dir, ".git")); err != nil {
return err
}
} else {
/// ... |
|
I am not sure if there is any downside to removing the .git dir when submodules are involved.. I'd assume they become "vendored" into the project vs. a link. |
In that case maybe people can manually add the submodule to the parent repo, since the .gitmodules file is still present |
nilslice
left a comment
There was a problem hiding this comment.
ah, good idea to use the original clone!
@bhelx is a git wizard 🪄 |
|
I assume it’s safe whether the module has sub modules or not but please double check
…On May 23, 2024 at 6:06 PM -0500, Muhammad Azeez ***@***.***>, wrote:
Merged #88 into main.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
tested it with the go pdk template, seems to be working |
Fixes #87