-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.go
More file actions
57 lines (50 loc) · 1.85 KB
/
config.go
File metadata and controls
57 lines (50 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* @Desc:Global configuration handling.
* @Author: TaceyWong
* @Date: 2020-09-23 16:58:12
* @Last Modified by: TaceyWong
* @Last Modified time: 2020-09-23 17:43:25
*/
package starter
// UserConfigPath location of user's config
const UserConfigPath string = ""
// BuiltinAbbreviations built-in cvs format
var BuiltinAbbreviations = map[string]string{
"gh": "https://github.com/{0}.git",
"gl": "https://gitlab.com/{0}.git",
"bb": "https://bitbucket.org/{0}",
}
// DefaultConfig Starter default config
var DefaultConfig = map[string]interface{}{
"starter_dir": "~/.starter/",
"replay_dir": "~/.starter_replay/",
"default_context": map[string][]string{},
"abbreviations": BuiltinAbbreviations,
}
// MergeConfigs Recursively update a dict with the key/value pair of another.
//
// Dict values that are dictionaries themselves will be updated, whilst preserving existing keys.
func MergeConfigs(defaultC, overwriteC map[string]interface{}) map[string]interface{} {
return nil
}
// GetConfig Retrieve the config from the specified path, returning a config dict.
func GetConfig(configPath string) map[string]interface{} {
return nil
}
// GetUserConfig Return the user config as a dict.
//
// If ``default_config`` is True, ignore ``config_file`` and return default
// values for the config parameters.
//
// If a path to a ``config_file`` is given, that is different from the default
// location, load the user config from that.
//
// Otherwise look up the config file path in the ``COOKIECUTTER_CONFIG`
// environment variable. If set, load the config from this path. This will
// raise an error if the specified path is not valid.
//
// If the environment variable is not set, try the default config file path
// before falling back to the default config values.
func GetUserConfig(configFile string, deaultConfig bool) map[string]interface{} {
return nil
}