From 2d45dd5e58f22cb4a9a766e82fe63f9958b410d1 Mon Sep 17 00:00:00 2001 From: moqsien Date: Mon, 18 Mar 2024 10:53:41 +0800 Subject: [PATCH] bugfix for typst --- pkgs/pxy/main.go | 20 ++++++++++---------- pkgs/versions/github.go | 15 ++++++++++++--- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/pkgs/pxy/main.go b/pkgs/pxy/main.go index 81c0260..26c014a 100644 --- a/pkgs/pxy/main.go +++ b/pkgs/pxy/main.go @@ -60,16 +60,16 @@ func main() { // php.FetchAll() // php.Upload() - ins := versions.NewInstaller(cfg) - ins.GetAndroidSDKManager() - ins.GetVSCode() - ins.GetMiniconda() - ins.FetchAll() - ins.Upload() - - // gh := versions.NewGithubRepo(cfg) - // gh.FetchAll() - // gh.Upload() + // ins := versions.NewInstaller(cfg) + // ins.GetAndroidSDKManager() + // ins.GetVSCode() + // ins.GetMiniconda() + // ins.FetchAll() + // ins.Upload() + + gh := versions.NewGithubRepo(cfg) + gh.FetchAll() + gh.Upload() // scala := versions.NewScala(cfg) // scala.FetchAll() diff --git a/pkgs/versions/github.go b/pkgs/versions/github.go index 0949c80..0d26017 100644 --- a/pkgs/versions/github.go +++ b/pkgs/versions/github.go @@ -81,14 +81,14 @@ func filterGithubByUrl(dUrl string) bool { "-profile.zip", // for bun "denort-", // for deno // "-unknown-linux-musl.tar.gz", // for fd. - "-pc-windows-msvc.zip", // for fd. + "fd$pc-windows-msvc.zip", // for fd. "linux-gnueabihf", // for fd "linux-musleabihf", // for fd "kotlin-compiler-", // for kotlin "unknown-linux-gnueabihf.", // for ripgrep "unknown-linux-musleabi.", // for ripgrep "unknown-linux-musleabihf.", // for ripgrep - "pc-windows-msvc.zip", // for ripgrep + "ripgrep$pc-windows-msvc.zip", // for ripgrep "arm-unknown-linux-gnueabihf", // for typst-lsp "typst-lsp-x86_64-unknown-linux-musl", // for typst-lsp "-unknown-linux-musleabi.", // for typst @@ -110,8 +110,14 @@ func filterGithubByUrl(dUrl string) bool { "cs-x86_64-pc-win32.zip", // for coursier "coursier.jar", // for coursier } + for _, s := range excludeList { - if strings.Contains(dUrl, s) { + if strings.Contains(s, "$") { + ss := strings.Split(s, "$") + if strings.Contains(dUrl, ss[0]) && strings.Contains(dUrl, ss[1]) { + return false + } + } else if strings.Contains(dUrl, s) { return false } } @@ -143,6 +149,9 @@ func (g *GithubRepo) fetchRepo(repo string) { ver := &VFile{} ver.Url = asset.Url if filterGithubByUrl(asset.Url) { + // if strings.Contains(asset.Url, "typst-") && strings.Contains(asset.Url, "windows") { + // fmt.Println(asset.Url) + // } ver.Arch = utils.ParseArch(asset.Url) ver.Os = utils.ParsePlatform(asset.Url) for _, n := range ToFindVersionList {