File tree 4 files changed +10
-9
lines changed
darwin/MultiMC-Curseforge.app/Contents/MacOS
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
+
1
4
all : clean darwin linux-386 linux-amd64 windows
2
5
3
6
clean :
@@ -7,19 +10,19 @@ clean:
7
10
8
11
darwin :
9
12
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
11
14
tar -czvf ./output/darwin.tar.gz --exclude .gitkeep -C ./build/darwin .
12
15
13
16
linux-386 :
14
17
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
16
19
tar -czvf ./output/linux-386.tar.gz --exclude .gitkeep -C ./build/linux .
17
20
18
21
linux-amd64 :
19
22
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
21
24
tar -czvf ./output/linux-amd64.tar.gz --exclude .gitkeep -C ./build/linux .
22
25
23
26
windows :
24
27
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 9
9
"os"
10
10
"os/exec"
11
11
"runtime"
12
- "strings"
13
12
)
14
13
15
14
// Package - CCIP file structure
@@ -31,8 +30,7 @@ func main() {
31
30
32
31
url , err := url .ParseRequestURI (os .Args [1 ])
33
32
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" ))
36
34
} else {
37
35
pkg := LoadXML (os .Args [1 ])
38
36
pack = GetPackURL (pkg .Project .ID , pkg .Project .File )
@@ -70,8 +68,8 @@ func LoadXML(fileName string) Package {
70
68
}
71
69
72
70
// 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" )
75
73
if err != nil {
76
74
fmt .Println (err )
77
75
os .Exit (1 )
You can’t perform that action at this time.
0 commit comments