@@ -3,7 +3,6 @@ package util
3
3
import (
4
4
"encoding/json"
5
5
"fmt"
6
- "os"
7
6
8
7
"github.com/cocoide/commitify/internal/entity"
9
8
"github.com/spf13/viper"
@@ -12,14 +11,6 @@ import (
12
11
func ReadConfig () (* entity.Config , error ) {
13
12
var result entity.Config
14
13
15
- // configファイルがあるかどうかを確認
16
- _ , err := os .Stat ("config.yaml" )
17
- if os .IsNotExist (err ) {
18
- if _ , err := os .Create ("config.yaml" ); err != nil {
19
- return & result , fmt .Errorf ("error creating config file, %s" , err .Error ())
20
- }
21
- }
22
-
23
14
viper .AddConfigPath ("." )
24
15
viper .SetConfigName ("config" )
25
16
viper .SetConfigType ("yaml" )
@@ -33,14 +24,6 @@ func ReadConfig() (*entity.Config, error) {
33
24
}
34
25
35
26
func WriteConfig (config * entity.Config ) error {
36
- // configファイルがあるかどうかを確認
37
- _ , err := os .Stat ("config.yaml" )
38
- if ! os .IsNotExist (err ) {
39
- if _ , err := os .Create ("config.yaml" ); err != nil {
40
- return fmt .Errorf ("error creating config file, %s" , err .Error ())
41
- }
42
- }
43
-
44
27
viper .AddConfigPath ("." )
45
28
viper .SetConfigName ("config" )
46
29
viper .SetConfigType ("yaml" )
0 commit comments