mirror of
https://github.com/taigrr/mg.git
synced 2026-04-02 03:28:42 -07:00
Compare commits
1 Commits
v0.1.1
...
burrow/ref
| Author | SHA1 | Date | |
|---|---|---|---|
| 9ad9412a8c |
@@ -44,8 +44,7 @@ func (m MRConfig) ToMGConfig() MGConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// LoadMRConfig loads the mrconfig file from the user's home directory
|
// LoadMRConfig loads the mrconfig file from the user's home directory
|
||||||
// and returns a MRConfig struct
|
// and returns a MRConfig struct with all repos and aliases from the [DEFAULT] section
|
||||||
// TODO: load aliases into map instead of hardcoded Unregister prop
|
|
||||||
func LoadMRConfig() (MRConfig, error) {
|
func LoadMRConfig() (MRConfig, error) {
|
||||||
home, err := os.UserHomeDir()
|
home, err := os.UserHomeDir()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -107,16 +106,8 @@ func LoadMRConfig() (MRConfig, error) {
|
|||||||
config.Repos[length].Remote = split[1]
|
config.Repos[length].Remote = split[1]
|
||||||
|
|
||||||
case "default":
|
case "default":
|
||||||
|
// Load all DEFAULT section aliases into the map
|
||||||
// TODO load text into Aliases map instead of hardcoded Unregister prop
|
config.Aliases[split[0]] = split[1]
|
||||||
switch split[0] {
|
|
||||||
case "unregister":
|
|
||||||
config.Aliases["unregister"] = split[1]
|
|
||||||
case "git_gc":
|
|
||||||
config.Aliases["gc"] = split[1]
|
|
||||||
default:
|
|
||||||
return MRConfig{}, fmt.Errorf("unexpected argument on line %d: %s", n, line)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return config, nil
|
return config, nil
|
||||||
|
|||||||
Reference in New Issue
Block a user