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
Add create command #167
Add create command #167
Conversation
} | ||
return modules | ||
return modules, mappedSources |
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.
is it bad to just add source to the moduleConfig itself?
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.
ModuleConfig represents the structure of the module file, so we don't want it in there.
wg := sync.WaitGroup{} | ||
wg.Add(len(projectConfig.Modules)) | ||
for _, mod := range projectConfig.Modules { | ||
go module.FetchModule(mod.Files.Source, &wg) |
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.
Trying to understand how the go-getter stuff works
this will not download again if it's already on local? for Get()
on their docs they say
"If dst already exists, Get will attempt to update it."
and the isLocal
function always receives the remote-source only, to do the getter.Detect
, is getter.Get where the magic happens?
zero/internal/module/module.go
Lines 23 to 29 in 1a1ce93
localPath := GetSourceDir(source) | |
if !isLocal(source) { | |
err := getter.Get(localPath, source) | |
if err != nil { | |
exit.Fatal("Failed to fetch remote module from %s: %v\n", source, err) | |
} | |
} |
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.
Yeah right now it may fetch it again, but so far it's fast enough that it hasn't been a problem. I want to go over this stuff again at some point anyway to have these temporary files in a global location rather than written to a local tmp
directory. At that point we can put more thought into if/how we want to cache these files.
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 see, was just trying to figure out what it does
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.
Also the source location you provide can be local, not just remote, which is why we have that isLocal
check there.
No description provided.