Skip to content

Commit 9d75cef

Browse files
committed
Curseforge split from Twitch
1 parent aa291c4 commit 9d75cef

File tree

11 files changed

+31
-33
lines changed

11 files changed

+31
-33
lines changed

Makefile

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@ all: clean darwin linux-386 linux-amd64 windows
22

33
clean:
44
-rm -rf ./output
5-
-rm ./build/darwin/MultiMC-Twitch.app/Contents/MacOS/MultiMC-Twitch
6-
-rm ./build/linux/usr/bin/multimc-twitch
5+
-rm ./build/darwin/MultiMC-Curseforge.app/Contents/MacOS/MultiMC-Curseforge
6+
-rm ./build/linux/usr/bin/multimc-curseforge
77

88
darwin:
99
mkdir -p output
10-
GOOS=darwin GOARCH=amd64 go build -o ./build/darwin/MultiMC-Twitch.app/Contents/MacOS/MultiMC-Twitch
10+
GOOS=darwin GOARCH=amd64 go build -o ./build/darwin/MultiMC-Curseforge.app/Contents/MacOS/MultiMC-Curseforge
1111
tar -czvf ./output/darwin.tar.gz --exclude .gitkeep -C ./build/darwin .
1212

1313
linux-386:
1414
mkdir -p output
15-
GOOS=linux GOARCH=386 go build -o ./build/linux/usr/bin/multimc-twitch
15+
GOOS=linux GOARCH=386 go build -o ./build/linux/usr/bin/multimc-curseforge
1616
tar -czvf ./output/linux-386.tar.gz --exclude .gitkeep -C ./build/linux .
1717

1818
linux-amd64:
1919
mkdir -p output
20-
GOOS=linux GOARCH=amd64 go build -o ./build/linux/usr/bin/multimc-twitch
20+
GOOS=linux GOARCH=amd64 go build -o ./build/linux/usr/bin/multimc-curseforge
2121
tar -czvf ./output/linux-amd64.tar.gz --exclude .gitkeep -C ./build/linux .
2222

2323
windows:
2424
mkdir -p output
25-
GOOS=windows GOARCH=386 go build -o ./output/MultiMC-Twitch.exe
25+
GOOS=windows GOARCH=386 go build -o ./output/MultiMC-Curseforge.exe

README.md

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
# MultiMC-Twitch
1+
# MultiMC-Curseforge
22

3-
A simple Go program that handles Twitch's custom protocol and ccip files
4-
1. Reads the [CurseForge] `.ccip` file or [Twitch] `twitch://` protocol
5-
2. Requests the [TwitchAPI] to get the zip url
3+
A simple Go program that handles Curseforge's custom protocol and ccip files
4+
1. Reads the [CurseForge] `.ccip` file or `curseforge://` protocol
5+
2. Requests the [CurseForge] to get the zip url
66
3. Launches [MultiMC] with the `--import` flag, with the url
77

88
Instructions:
9-
- macOS - Move `MultiMC-Twitch.app` into `Applications`
9+
- macOS - Move `MultiMC-Curseforge.app` into `Applications`
1010
- Linux - [AUR] or Manually install files into system
11-
- Windows - Move `MultiMC-Twitch.exe` into `MultiMC` folder and execute as admin once
11+
- Windows - Move `MultiMC-Curseforge.exe` into `MultiMC` folder and execute
1212

13-
Note: Having the Twitch app installed may break this.
13+
Note: Having the Curse app installed may break this.
1414

15-
[Download](https://github.com/ShayBox/MultiMC-Twitch/releases)
15+
[Download](https://github.com/ShayBox/MultiMC-Curseforge/releases)
1616

1717
[CurseForge]: https://www.curseforge.com/
18-
[Twitch]: https://twitch.tv/
19-
[TwitchAPI]: https://twitchappapi.docs.apiary.io/
2018
[MultiMC]: https://multimc.org/
21-
[AUR]: https://aur.archlinux.org/packages/multimc-twitch/
19+
[AUR]: https://aur.archlinux.org/packages/multimc-curseforge/

build/darwin/MultiMC-Twitch.app/Contents/Info.plist build/darwin/MultiMC-Curseforge.app/Contents/Info.plist

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
<plist version="1.0">
44
<dict>
55
<key>CFBundleExecutable</key>
6-
<string>MultiMC-Twitch</string>
6+
<string>MultiMC-Curseforge</string>
77
<key>CFBundleIdentifier</key>
8-
<string>com.shaybox.multimc-twitch</string>
8+
<string>com.shaybox.multimc-curseforge</string>
99
<key>NSUIElement</key>
1010
<true/>
1111
<key>CFBundleURLTypes</key>
1212
<array>
1313
<dict>
1414
<key>CFBundleURLName</key>
15-
<string>Twitch</string>
15+
<string>Curseforge</string>
1616
<key>CFBundleURLSchemes</key>
1717
<array>
18-
<string>twitch</string>
18+
<string>curseforge</string>
1919
</array>
2020
</dict>
2121
</array>
Binary file not shown.
6.58 MB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[Desktop Entry]
2+
Type=Application
3+
Name=MultiMC-Curseforge
4+
Exec=multimc-curseforge %u
5+
Terminal=false
6+
MimeType=x-scheme-handler/curseforge;

build/linux/usr/share/applications/multimc-twitch.desktop

-6
This file was deleted.

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/shaybox/multimc-twitch
1+
module github.com/shaybox/multimc-curseforge
22

33
go 1.14
44

main.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"strings"
1313
)
1414

15-
// Package - XML structure the Twitch CCIP files
15+
// Package - CCIP file structure
1616
type Package struct {
1717
XMLName xml.Name `xml:"package"`
1818
Project struct {
@@ -30,7 +30,7 @@ func main() {
3030
var pack string
3131

3232
url, err := url.ParseRequestURI(os.Args[1])
33-
if err == nil && url.Scheme == "twitch" {
33+
if err == nil && url.Scheme == "curseforge" {
3434
paths := strings.Split(url.Path, "/")
3535
pack = GetPackURL(paths[3], paths[5])
3636
} else {
@@ -69,7 +69,7 @@ func LoadXML(fileName string) Package {
6969
return pkg
7070
}
7171

72-
// GetPackURL - Request the download url from Twitch's API
72+
// GetPackURL - Request the download url from Curseforge's API
7373
func GetPackURL(id string, file string) string {
7474
resp, err := http.Get("https://addons-ecs.forgesvc.net/api/v2/addon/" + id + "/file/" + file + "/download-url")
7575
if err != nil {

main_windows.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ func init() {
3434
}
3535

3636
func UpdateRegistry() error {
37-
key, _, err := registry.CreateKey(registry.CLASSES_ROOT, "twitch", registry.WRITE)
37+
key, _, err := registry.CreateKey(registry.CLASSES_ROOT, "curseforge", registry.WRITE)
3838
if err != nil {
3939
return err
4040
}
4141

4242
defer key.Close()
4343

44-
err = key.SetStringValue("", "URL: Twitch Handler")
44+
err = key.SetStringValue("", "URL: CurseForge Protocol")
4545
if err != nil {
4646
return err
4747
}

0 commit comments

Comments
 (0)