Skip to content

Commit

Permalink
Introduce config_dir(), move both to os_ specific files.
Browse files Browse the repository at this point in the history
Breaks windows build. Will be fixed in a moment.
  • Loading branch information
nsf committed Dec 26, 2012
1 parent cb4774c commit fc33e06
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 1 addition & 5 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import (
"strconv"
)

func config_file() string {
return filepath.Join(xdg_home_dir(), "gocode", "config.json")
}

//-------------------------------------------------------------------------
// config
//
Expand Down Expand Up @@ -135,7 +131,7 @@ func (this *config) write() error {
}

// make sure config dir exists
dir := filepath.Join(xdg_home_dir(), "gocode")
dir := config_dir()
if !file_exists(dir) {
os.MkdirAll(dir, 0755)
}
Expand Down
10 changes: 10 additions & 0 deletions os_posix.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,13 @@ func get_executable_filename() string {
}
return ""
}

// config location

func config_dir() string {
return filepath.Join(xdg_home_dir(), "gocode")
}

func config_file() string {
return filepath.Join(xdg_home_dir(), "gocode", "config.json")
}

0 comments on commit fc33e06

Please sign in to comment.