-
Notifications
You must be signed in to change notification settings - Fork 265
[global] Implement simple global pull #630
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
Conversation
func globalPullCmd() *cobra.Command { | ||
return &cobra.Command{ | ||
Use: "pull <file> | <url>", | ||
Short: "Pulls a global config from a file or URL", |
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.
it seems that url requires the scheme. That's non-obvious but very reasonable, so could we specify an example in the Long explanation?
|
||
func (d *Devbox) PullGlobal(path string) error { | ||
u, err := url.Parse(path) | ||
if err == nil && u.Scheme != "" { |
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.
scheme requirement is here (ref. previous comment above)
return "", err | ||
} | ||
nixDirPath := filepath.Join(configPath, "nix") | ||
_ = os.MkdirAll(nixDirPath, 0755) |
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.
lets check the err
## Summary This is stacked on #630 This moves global data to XDG_DATA_HOME or `~/.local/share` * The devbox.json is stored in `~/.local/share/devbox/global/default/devbox.json` * The nix profile is in `~/.local/share/devbox/global/default/nix-profile` * the bin path is `~/.local/share/devbox/global/current/nix-profile/bin` ## How was it tested? `devbox global add hello`
Summary
This "pulls" a global config either from a local path or URL. It merges the packages into the existing config.
How was it tested?