Skip to content

Commit c34a201

Browse files
committed
Fix workflow and readme
1 parent a6d7d35 commit c34a201

File tree

3 files changed

+73
-1
lines changed

3 files changed

+73
-1
lines changed

Diff for: .github/workflows/go.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ jobs:
2626
goversion: 1.17
2727
goos: ${{ matrix.goos }}
2828
goarch: ${{ matrix.goarch }}
29-
binary_name: "CurseForgeExporter-${{github.ref_name}}"
29+
binary_name: "CFExporter"
3030
pre_command: "sed -i 's/${VERSION}/${{github.ref_name}}/g' main.go"

Diff for: README.md

+66
Original file line numberDiff line numberDiff line change
@@ -1 +1,67 @@
11
CurseforgeExporter
2+
3+
# Usage Guide
4+
5+
## Step 1
6+
You will need to create a config file named `.build.json`.
7+
This file contains the settings and values that will be used to create the export.
8+
9+
You can use the following template for the `.build.json`
10+
11+
```json
12+
{
13+
"packAuthor": "FTB",
14+
"minecraftVersion": "1.12.2",
15+
"modLoader": "forge",
16+
"modLoaderVersion": "14.23.4.2756",
17+
"includes": ["config", "options.txt", "map", "resources"]
18+
}
19+
```
20+
21+
| Object | Type | Value |
22+
|--------------------|----------------|-------------------------------------------------------------------------------------------------------|
23+
| `packAuthor` | `String` | Sets the author of the pack |
24+
| `minecraftVersion` | `String` | Sets the minecraft version to use |
25+
| `modLoader` | `string` | Defines what mod loader to use |
26+
| `modLoaderVersion` | `String` | Defines the mod loader version to use |
27+
| `includes` | `String Array` | Array defining the files/folders to include in the export, you should not add the mods folder to this |
28+
29+
---
30+
## Step 2
31+
Use the following command to run the exporter tool
32+
33+
### Flags
34+
35+
| Flag | Default | Description |
36+
|-----------|---------------------|-------------------------------|
37+
| `-d` | `./` | Path to Minecraft instance |
38+
| `-o` | `./out` | Location to output export zip |
39+
| `-c` | `./.build.json` | Path to .build.json |
40+
| `-n` | `CurseForge-Export` | Name of export |
41+
| `-v` | `1.0.0` | Version of the export |
42+
| `-silent` | `false` | Enable silent output |
43+
| `-debug` | `false` | Enable debug logging |
44+
| `-help` | `false` | Shows help text |
45+
46+
### Windows
47+
Open command prompt in the same folder as `CFExporter.exe` and run the following command
48+
49+
`CFExporter.exe -d "<path to mc instance>" -c "<path to .build.json>"`
50+
51+
Run `twitch_export-win.exe -help` for help
52+
53+
### Mac/Linux
54+
Open terminal in the same folder as `CFExporter` and run the following command
55+
56+
`CFExporter -d "<path to mc instance>" -c "<path to .build.json>"`
57+
58+
Run `CFExporter -h` for help
59+
60+
### Curse Auth token
61+
To get a curse authentication token you will need to send a post request to https://logins-v1.curseapp.net/login with the body of a Curse email and password. See https://logins-v1.curseapp.net/help for help
62+
63+
64+
---
65+
# Issues
66+
67+
If you are having any issues please create a new issue

Diff for: main.go

+6
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,12 @@ func genExport(projectFiles []FingerprintExactMatches) {
253253
pterm.Error.Println("Failed to write manifest:", err)
254254
os.Exit(1)
255255
}
256+
if _, err := os.Stat(*outputDir); os.IsNotExist(err) {
257+
err := os.Mkdir(*outputDir, os.ModePerm)
258+
if err != nil {
259+
pterm.Error.Println("Failed to create output directory:", err)
260+
}
261+
}
256262
err = RecursiveZip(tmpDir, path.Join(*outputDir, *exportName+"-"+*exportVersion+".zip"))
257263
if err != nil {
258264
pterm.Error.Println("Failed to zip export:", err)

0 commit comments

Comments
 (0)