File tree Expand file tree Collapse file tree 4 files changed +10
-9
lines changed
darwin/MultiMC-Curseforge.app/Contents/MacOS Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 1+ GOCMD =go
2+ GOFLAGS =-o trace -gcflags "all=-trimpath=$GOPATH"
3+
14all : clean darwin linux-386 linux-amd64 windows
25
36clean :
@@ -7,19 +10,19 @@ clean:
710
811darwin :
912 mkdir -p output
10- GOOS=darwin GOARCH=amd64 go build -o ./build/darwin/MultiMC-Curseforge.app/Contents/MacOS/MultiMC-Curseforge
13+ GOOS=darwin GOARCH=amd64 $( GOCMD ) build $( GOFLAGS ) -o ./build/darwin/MultiMC-Curseforge.app/Contents/MacOS/MultiMC-Curseforge
1114 tar -czvf ./output/darwin.tar.gz --exclude .gitkeep -C ./build/darwin .
1215
1316linux-386 :
1417 mkdir -p output
15- GOOS=linux GOARCH=386 go build -o ./build/linux/usr/bin/multimc-curseforge
18+ GOOS=linux GOARCH=386 $( GOCMD ) build $( GOFLAGS ) -o ./build/linux/usr/bin/multimc-curseforge
1619 tar -czvf ./output/linux-386.tar.gz --exclude .gitkeep -C ./build/linux .
1720
1821linux-amd64 :
1922 mkdir -p output
20- GOOS=linux GOARCH=amd64 go build -o ./build/linux/usr/bin/multimc-curseforge
23+ GOOS=linux GOARCH=amd64 $( GOCMD ) build $( GOFLAGS ) -o ./build/linux/usr/bin/multimc-curseforge
2124 tar -czvf ./output/linux-amd64.tar.gz --exclude .gitkeep -C ./build/linux .
2225
2326windows :
2427 mkdir -p output
25- GOOS=windows GOARCH=386 go build -o ./output/MultiMC-Curseforge.exe
28+ GOOS=windows GOARCH=386 $( GOCMD ) build $( GOFLAGS ) -o ./output/MultiMC-Curseforge.exe
Original file line number Diff line number Diff line change 99 "os"
1010 "os/exec"
1111 "runtime"
12- "strings"
1312)
1413
1514// Package - CCIP file structure
@@ -31,8 +30,7 @@ func main() {
3130
3231 url , err := url .ParseRequestURI (os .Args [1 ])
3332 if err == nil && url .Scheme == "curseforge" {
34- paths := strings .Split (url .Path , "/" )
35- pack = GetPackURL (paths [3 ], paths [5 ])
33+ pack = GetPackURL (url .Query ().Get ("addonId" ), url .Query ().Get ("fileId" ))
3634 } else {
3735 pkg := LoadXML (os .Args [1 ])
3836 pack = GetPackURL (pkg .Project .ID , pkg .Project .File )
@@ -70,8 +68,8 @@ func LoadXML(fileName string) Package {
7068}
7169
7270// GetPackURL - Request the download url from Curseforge's API
73- func GetPackURL (id string , file string ) string {
74- resp , err := http .Get ("https://addons-ecs.forgesvc.net/api/v2/addon/" + id + "/file/" + file + "/download-url" )
71+ func GetPackURL (addon string , file string ) string {
72+ resp , err := http .Get ("https://addons-ecs.forgesvc.net/api/v2/addon/" + addon + "/file/" + file + "/download-url" )
7573 if err != nil {
7674 fmt .Println (err )
7775 os .Exit (1 )
You can’t perform that action at this time.
0 commit comments