File tree 3 files changed +21
-5
lines changed
3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 1
1
module github.com/shaybox/multimc-curseforge
2
2
3
- go 1.14
3
+ go 1.16
4
4
5
- require golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b
5
+ require golang.org/x/sys v0.0.0-20210309074719-68d13333faf2
Original file line number Diff line number Diff line change 1
- golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b h1:ggRgirZABFolTmi3sn6Ivd9SipZwLedQ5wR0aAKnFxU =
2
- golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b /go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs =
1
+ golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 h1:46ULzRKLh1CwgRq2dC5SlBzEqqNCi8rreOZnNrbqcIY =
2
+ golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 /go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs =
Original file line number Diff line number Diff line change @@ -79,7 +79,13 @@ func main() {
79
79
}
80
80
81
81
path = home + "/.local/share/multimc/icons/" + addonInfo .Name
82
- args = []string {"multimc" , "--import" , pack }
82
+ // Workaround for hacky MultiMC.deb package wrapper
83
+ deb := "/opt/multimc/run.sh"
84
+ if FileExists (deb ) {
85
+ args = []string {deb , "--import" , pack }
86
+ } else {
87
+ args = []string {"multimc" , "--import" , pack }
88
+ }
83
89
case "windows" :
84
90
executable , err := os .Executable ()
85
91
if err != nil {
@@ -207,3 +213,13 @@ func RunCMD(args []string) {
207
213
208
214
cmd .Wait ()
209
215
}
216
+
217
+ // FileExists checks if a file exists and is not a directory before we
218
+ // try using it to prevent further errors.
219
+ func FileExists (filename string ) bool {
220
+ info , err := os .Stat (filename )
221
+ if os .IsNotExist (err ) {
222
+ return false
223
+ }
224
+ return ! info .IsDir ()
225
+ }
You can’t perform that action at this time.
0 commit comments