Skip to content

Commit

Permalink
typst-preview
Browse files Browse the repository at this point in the history
  • Loading branch information
moqsien committed Mar 19, 2024
1 parent c19b707 commit 7cc37d5
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 33 deletions.
3 changes: 2 additions & 1 deletion pkgs/confs/github_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ charmbracelet/vhs
charmbracelet/glow
gleam-lang/gleam
jesseduffield/lazygit
coursier/coursier`
coursier/coursier
Enter-tainer/typst-preview`
21 changes: 14 additions & 7 deletions pkgs/pxy/main.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
package main

import (
"os"

"github.com/gvcgo/collector/pkgs/confs"
"github.com/gvcgo/collector/pkgs/versions"
)

func main() {
// sites.TestEDomains()
// sites.TestEDCollector()
// sites.TestTDomains()
// os.Setenv(confs.ToEnableProxyEnvName, "true")
app := NewApp()
app.Run()
os.Setenv(confs.ToEnableProxyEnvName, "true")
// app := NewApp()
// app.Run()

// cfg := confs.NewCollectorConf()
cfg := confs.NewCollectorConf()
// aj := versions.NewAdoptiumJDK(cfg)
// aj.FetchAll()
// aj.Upload()
Expand Down Expand Up @@ -60,9 +67,9 @@ func main() {
// ins.FetchAll()
// ins.Upload()

// gh := versions.NewGithubRepo(cfg)
// gh.FetchAll()
// gh.Upload()
gh := versions.NewGithubRepo(cfg)
gh.FetchAll()
gh.Upload()

// scala := versions.NewScala(cfg)
// scala.FetchAll()
Expand Down
55 changes: 30 additions & 25 deletions pkgs/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,32 @@ var ArchOSs map[string]string = map[string]string{
}

var ArchMap = map[string]string{
"amd64": "amd64",
"x86-64": "amd64",
"x86_64": "amd64",
"x64": "amd64",
"win64": "amd64",
"64-bit": "amd64",
"x86": "386",
"i586": "386",
"i686": "386",
"i386": "386",
"win32": "386",
"32-bit": "386",
"arm64": "arm64",
"aarch64": "arm64",
"aarch_64": "arm64",
"arm32": "arm",
"armv6": "arm",
"ppc64le": "ppc64le",
"ppcle_64": "ppc64le",
"s390x": "s390x",
"s390_64": "s390x",
"powerpc64": "ppc64",
"ppc64": "ppc64",
"universal": "universal",
"win32-arm64": "arm64",
"amd64": "amd64",
"x86-64": "amd64",
"x86_64": "amd64",
"x64": "amd64",
"win64": "amd64",
"64-bit": "amd64",
"ia32": "386",
"x86": "386",
"i586": "386",
"i686": "386",
"i386": "386",
"win32": "386",
"32-bit": "386",
"arm64": "arm64",
"aarch64": "arm64",
"aarch_64": "arm64",
"arm32": "arm",
"armv6": "arm",
"ppc64le": "ppc64le",
"ppcle_64": "ppc64le",
"s390x": "s390x",
"s390_64": "s390x",
"powerpc64": "ppc64",
"ppc64": "ppc64",
"universal": "universal",
}

var PlatformMap = map[string]string{
Expand Down Expand Up @@ -87,7 +89,10 @@ const (
func ParseArch(name string) string {
name = strings.ToLower(name)
if strings.Contains(name, "win32-x64") {
return "any"
return "amd64"
}
if strings.Contains(name, "win32-arm64") {
return "arm64"
}
for k, v := range ArchMap {
if k == "x86" && strings.Contains(name, k) && (strings.Contains(name, "x86_64") || strings.Contains(name, "x86-64")) {
Expand Down
6 changes: 6 additions & 0 deletions pkgs/versions/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ func filterGithubByUrl(dUrl string) bool {
"cs-x86_64-pc-linux.gz", // for coursier
"cs-x86_64-pc-win32.zip", // for coursier
"coursier.jar", // for coursier
"typst-preview$index.html",
"typst-preview$.debug",
"typst-preview$.dwarf",
"typst-preview$.pdb",
"typst-preview$alpine",
"typst-preview$armhf",
}

for _, s := range excludeList {
Expand Down

0 comments on commit 7cc37d5

Please sign in to comment.