Skip to content

Commit 3d36dc0

Browse files
author
Youngjin Jo
authored
Merge pull request #93 from yjinjo/master
hange toml to yaml for short names
2 parents 6c581b9 + 7625450 commit 3d36dc0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

cmd/other/shortNames.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ func validateServiceCommand(service, verb, resource string) error {
2929
}
3030

3131
mainV := viper.New()
32-
mainV.SetConfigFile(filepath.Join(home, ".cfctl", "setting.toml"))
33-
mainV.SetConfigType("toml")
32+
mainV.SetConfigFile(filepath.Join(home, ".cfctl", "setting.yaml"))
33+
mainV.SetConfigType("yaml")
3434
if err := mainV.ReadInConfig(); err != nil {
3535
return fmt.Errorf("failed to read config: %v", err)
3636
}
@@ -208,10 +208,10 @@ func addShortName(service, shortName, command string) error {
208208
return fmt.Errorf("failed to get home directory: %v", err)
209209
}
210210

211-
settingPath := filepath.Join(home, ".cfctl", "setting.toml")
211+
settingPath := filepath.Join(home, ".cfctl", "setting.yaml")
212212
v := viper.New()
213213
v.SetConfigFile(settingPath)
214-
v.SetConfigType("toml")
214+
v.SetConfigType("yaml")
215215

216216
if err := v.ReadInConfig(); err != nil && !os.IsNotExist(err) {
217217
return fmt.Errorf("failed to read config: %v", err)
@@ -232,10 +232,10 @@ func removeShortName(service, shortName string) error {
232232
return fmt.Errorf("failed to get home directory: %v", err)
233233
}
234234

235-
settingPath := filepath.Join(home, ".cfctl", "setting.toml")
235+
settingPath := filepath.Join(home, ".cfctl", "setting.yaml")
236236
v := viper.New()
237237
v.SetConfigFile(settingPath)
238-
v.SetConfigType("toml")
238+
v.SetConfigType("yaml")
239239

240240
if err := v.ReadInConfig(); err != nil {
241241
return fmt.Errorf("failed to read config: %v", err)
@@ -266,10 +266,10 @@ func listShortNames() (map[string]interface{}, error) {
266266
return nil, fmt.Errorf("failed to get home directory: %v", err)
267267
}
268268

269-
settingPath := filepath.Join(home, ".cfctl", "setting.toml")
269+
settingPath := filepath.Join(home, ".cfctl", "setting.yaml")
270270
v := viper.New()
271271
v.SetConfigFile(settingPath)
272-
v.SetConfigType("toml")
272+
v.SetConfigType("yaml")
273273

274274
if err := v.ReadInConfig(); err != nil {
275275
if os.IsNotExist(err) {

0 commit comments

Comments
 (0)