DefaultWorkspaceDir provides a sensible default for the Exercism workspace. The default is different depending on the platform, in order to best match the conventions for that platform. It places the directory in the user's home path.
(cfg Config)
| 103 | // the conventions for that platform. |
| 104 | // It places the directory in the user's home path. |
| 105 | func DefaultWorkspaceDir(cfg Config) string { |
| 106 | dir := cfg.DefaultDirName |
| 107 | if cfg.OS != "linux" { |
| 108 | dir = strings.Title(dir) |
| 109 | } |
| 110 | return filepath.Join(cfg.Home, dir) |
| 111 | } |
| 112 | |
| 113 | // Save persists a viper config of the base name. |
| 114 | func (c Config) Save(basename string) error { |
no outgoing calls