mirror of
https://github.com/Jguer/yay
synced 2024-07-23 19:24:12 +00:00
Fix completions from using wrong path. Regression introduced in filepath join
Signed-off-by: Jguer <me@jguer.space>
This commit is contained in:
parent
780f656531
commit
84569ef6d9
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue