Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
RestartFU committed Nov 3, 2024
1 parent 81424d5 commit e09f7e7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ module github.com/restartfu/simply-portmypack

go 1.23.0

require github.com/restartfu/portmypack v0.0.0-20240901033253-06919fc87ee8
require github.com/restartfu/portmypack v0.0.2-0.20241103002009-1d57a83ad945

require (
github.com/gofrs/flock v0.12.1 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
golang.org/x/sys v0.26.0 // indirect
Expand Down
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E=
github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/restartfu/portmypack v0.0.0-20240901033253-06919fc87ee8 h1:cz5UeCwfmUoSzyXZJQ1snKtQ4lySNkKZmEuJ7uFdz2w=
github.com/restartfu/portmypack v0.0.0-20240901033253-06919fc87ee8/go.mod h1:9i7NIJr1W9jm4bRFSuxB/oCa5SNr16twVoLLCauMo8Q=
github.com/restartfu/portmypack v0.0.1 h1:tCEILGaM4buZVOicEYZlxBJrHrDWMHhFQZvZdHNEHvk=
github.com/restartfu/portmypack v0.0.1/go.mod h1:9i7NIJr1W9jm4bRFSuxB/oCa5SNr16twVoLLCauMo8Q=
github.com/restartfu/portmypack v0.0.2-0.20241103001138-53c78de33aed h1:dV8Cuak0buMukYYE/6CTx1I7+dNDfb9BS0JuNLsLNpk=
github.com/restartfu/portmypack v0.0.2-0.20241103001138-53c78de33aed/go.mod h1:9i7NIJr1W9jm4bRFSuxB/oCa5SNr16twVoLLCauMo8Q=
github.com/restartfu/portmypack v0.0.2-0.20241103002009-1d57a83ad945 h1:OWiKJIrDMByAPWWpmPpcUdhh1J43m3XiPzuaRJbKUTM=
github.com/restartfu/portmypack v0.0.2-0.20241103002009-1d57a83ad945/go.mod h1:9i7NIJr1W9jm4bRFSuxB/oCa5SNr16twVoLLCauMo8Q=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
13 changes: 10 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package main

import (
"fmt"
"golang.org/x/sys/windows"
"log"
"math/rand"
"os"
"os/exec"
"strings"
"unsafe"

Expand All @@ -21,9 +24,13 @@ func main() {
log.Fatalln(err)
}

cache, _ := os.UserCacheDir()
appdata := cache + "\\Packages\\Microsoft.MinecraftUWP_8wekyb3d8bbwe\\LocalState\\games\\com.mojang\\resource_packs"
portmypack.PortJavaEditionPack(javapack, appdata)
out := fmt.Sprintf("%s\\portmypack-%d.mcpack", os.TempDir(), rand.Int63())
portmypack.PortJavaEditionPack(javapack, out)

err = exec.Command("cmd.exe", "/c", out).Run()
if err != nil {
log.Fatalln(err)
}
}

var (
Expand Down

0 comments on commit e09f7e7

Please sign in to comment.