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
ZER0155 update repo init to detect owner type #162
Conversation
internal/vcs/create-git-repos.go
Outdated
// takes a list of subdirectories containing modules to create a repository and do initial commit for | ||
func InitializeRepositories(moduleDirs []string, remoteRepository string, organizationName string, githubApiKey string) { | ||
ownerName, repositoryName, pErr := parseRepositoryUrl(repositoryUrl) | ||
if pErr != 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.
Any reason to not just have err
and reuse it?
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.
I like to keep errors scoped as close to the call as possible, but its not really needed here. I can change this to reuse a single err.
internal/vcs/create-git-repos.go
Outdated
remoteOrigin := fmt.Sprintf("%s/%s.git", remoteRepository, moduleDir) | ||
commands := []InitialCommands{ | ||
remoteOrigin := fmt.Sprintf("git@github.com:%s/%s.git", ownerName, repositoryName) | ||
fmt.Printf("remote origin: %s\n", remoteOrigin) |
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.
Probably not necessary to print
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.
Actually I think all the status prints in this probably aren't very useful to the user. Just one per repo saying we are creating a repo should be enough.
internal/vcs/create-git-repos.go
Outdated
ownerName := segments[1] | ||
repositoryName := segments[2] | ||
|
||
fmt.Printf("found owner %s, repository %s\n", ownerName, repositoryName) |
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.
not necessary to print
internal/vcs/create-git-repos.go
Outdated
return err | ||
} | ||
|
||
fmt.Printf("Repository successfully created for module: %s\n", repositoryName) |
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.
Just the above print should be enough
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.
Looks good after removing some of those print statements.
Thanks!
No description provided.