mirror of
https://github.com/Jguer/yay
synced 2024-10-15 20:42:19 +00:00
Correctly set config.AURURL after parsing flags
And also honour aururl during -Pc
This commit is contained in:
parent
0454e8918b
commit
2f545c7fdc
|
@ -13,7 +13,7 @@ import (
|
||||||
|
|
||||||
//CreateAURList creates a new completion file
|
//CreateAURList creates a new completion file
|
||||||
func createAURList(out *os.File) (err error) {
|
func createAURList(out *os.File) (err error) {
|
||||||
resp, err := http.Get("https://aur.archlinux.org/packages.gz")
|
resp, err := http.Get(config.AURURL + "/packages.gz")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
10
main.go
10
main.go
|
@ -4,13 +4,10 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"net/url"
|
|
||||||
|
|
||||||
alpm "github.com/jguer/go-alpm"
|
alpm "github.com/jguer/go-alpm"
|
||||||
rpc "github.com/mikkeloscar/aur"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func setPaths() error {
|
func setPaths() error {
|
||||||
|
@ -50,13 +47,6 @@ func initConfig() error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
url, err := url.Parse(config.AURURL)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
url.Path = path.Join(url.Path, "")
|
|
||||||
rpc.AURURL = url.String() + "/rpc.php?"
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,8 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"unicode"
|
"unicode"
|
||||||
|
|
||||||
|
rpc "github.com/mikkeloscar/aur"
|
||||||
)
|
)
|
||||||
|
|
||||||
// A basic set implementation for strings.
|
// A basic set implementation for strings.
|
||||||
|
@ -873,6 +875,9 @@ func (parser *arguments) extractYayOptions() {
|
||||||
parser.delArg(option)
|
parser.delArg(option)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rpc.AURURL = strings.TrimRight(config.AURURL, "/") + "/rpc.php?"
|
||||||
|
config.AURURL = strings.TrimRight(config.AURURL, "/")
|
||||||
}
|
}
|
||||||
|
|
||||||
//parses input for number menus splitted by spaces or commas
|
//parses input for number menus splitted by spaces or commas
|
||||||
|
|
Loading…
Reference in a new issue