Fix completions from using wrong path. Regression introduced in filepath join

Signed-off-by: Jguer <me@jguer.space>
This commit is contained in:
Jguer 2018-04-21 16:43:12 +01:00
parent 780f656531
commit 84569ef6d9
3 changed files with 3 additions and 10 deletions

View file

@ -68,14 +68,14 @@ func complete(shell string) error {
var path string
if shell == "fish" {
path = filepath.Join(completionFile, "fish"+".cache")
path = filepath.Join(cacheHome, "aur_fish"+".cache")
} else {
path = filepath.Join(completionFile, "sh"+".cache")
path = filepath.Join(cacheHome, "aur_sh"+".cache")
}
info, err := os.Stat(path)
if os.IsNotExist(err) || time.Since(info.ModTime()).Hours() > 48 {
os.MkdirAll(filepath.Dir(completionFile), 0755)
os.MkdirAll(filepath.Dir(path), 0755)
out, errf := os.Create(path)
if errf != nil {
return errf

View file

@ -64,9 +64,6 @@ const configFileName string = "config.json"
// vcsFileName holds the name of the vcs file.
const vcsFileName string = "vcs.json"
// completionFilePrefix holds the prefix used for storing shell completion files.
const completionFilePrefix string = "aur_"
// baseURL givers the AUR default address.
const baseURL string = "https://aur.archlinux.org"
@ -88,9 +85,6 @@ var configFile string
// vcsfile holds yay vcs info file path.
var vcsFile string
// completion file
var completionFile string
// shouldSaveConfig holds whether or not the config should be saved
var shouldSaveConfig bool

View file

@ -33,7 +33,6 @@ func initPaths() {
configFile = filepath.Join(configHome, configFileName)
vcsFile = filepath.Join(cacheHome, vcsFileName)
completionFile = filepath.Join(cacheHome, completionFilePrefix)
}
func initConfig() (err error) {