Skip to content

Commit

Permalink
bugfix: missing dirPath createAppConfigDir
Browse files Browse the repository at this point in the history
  • Loading branch information
kyokomi committed Sep 2, 2014
1 parent 3ea1ee6 commit 721c6c5
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions appConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func NewAppConfig(appName, configFileName string) *AppConfig {

// configファイルを作成する中身は空.
func (a AppConfig) WriteAppConfig(data []byte) error {
if err := createAppConfigDir(a.AppName); err != nil {
if err := createAppConfigDir(a.ConfigDirPath); err != nil {
return err
}
return ioutil.WriteFile(a.AppConfigFilePath(), data, os.FileMode(0644))
Expand All @@ -54,12 +54,7 @@ func (a AppConfig) RemoveAppConfig() error {

// ~/.{appName}ディレクトリを作成
// すでに存在する場合スルー
func createAppConfigDir(appName string) error {
dirPath, err := createAppConfigDirPath(appName)
if err != nil {
return err
}

func createAppConfigDir(dirPath string) error {
// check
if _, err := ioutil.ReadDir(dirPath); err == nil {
return nil
Expand Down

0 comments on commit 721c6c5

Please sign in to comment.