Skip to content

Commit

Permalink
fix unwanted char issue
Browse files Browse the repository at this point in the history
  • Loading branch information
cipheras committed Apr 25, 2021
1 parent 7159480 commit 3e4873d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v1.4.7
- fix issue of unwanted characters in some files

v1.4.6
- CLI enhancement
- Unpacking dir choice
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Or you can either use a **precompiled binary** package for your architecture or
### Download precompiled binary
Windows | Linux
--------|-------
[win-x64](https://github.com/cipheras/gopkgr/releases/download/v1.4.6/gopkgr-win-x64.exe) | [linux-x64](https://github.com/cipheras/gopkgr/releases/download/v1.4.6/gopkgr-linux-x64)
[win-x64](https://github.com/cipheras/gopkgr/releases/download/v1.4.7/gopkgr-win-x64.exe) | [linux-x64](https://github.com/cipheras/gopkgr/releases/download/v1.4.7/gopkgr-linux-x64)

For other versions or releases go to [release page](https://github.com/cipheras/gopkgr/releases).

Expand Down
22 changes: 11 additions & 11 deletions gopkgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ func pkr() {
fmt.Fprintf(f, "\"%v\",", path)
replacer := strings.NewReplacer("[", "{", "]", "}", " ", ",")
bytstr = append(bytstr, replacer.Replace(fmt.Sprint(filebyt)))
// count++
}
return nil
})
Expand All @@ -65,16 +64,17 @@ func pkr() {
fmt.Fprintf(f, "file := [][]byte{") //open byt
Cprint(N, "Starting packing")
time.Sleep(1 * time.Second)
replacer := strings.NewReplacer("[", "", "]", "", " ", "")
// replacer := strings.NewReplacer("[", "", "]", "", " ", "")
for i, v := range bytstr {
var ss []string
for i, c := range v {
if i%500 == 0 && i > 0 && string(c) != "," && string(c) != "0" && string(c) != "{" && string(c) != "}" {
ss = append(ss, "+ \n")
}
ss = append(ss, string(c))
}
fmt.Fprintf(f, "%v,", replacer.Replace(fmt.Sprint(ss)))
// var ss []string
// for i, c := range v {
// if i%1000 == 0 && i > 0 && string(c) != "," && string(c) != "0" && string(c) != "{" && string(c) != "}" {
// ss = append(ss, "+ \n")
// }
// ss = append(ss, string(c))
// }
// fmt.Fprintf(f, "%v,", replacer.Replace(fmt.Sprint(ss)))
fmt.Fprintf(f, "%v,", v)
fmt.Printf("\033[100D \033[48;5;22m:Packing [%v/%v]\033[0m [%v%v]", i+1, len(bytstr), strings.Repeat("#", i+1), strings.Repeat(".", len(bytstr)-i-1))
}
fmt.Fprintln(f, "}") //close byt
Expand Down Expand Up @@ -114,7 +114,7 @@ func unpkr(unpdir string) error{
if err != nil {
return err
}
//defer os.RemoveAll(unpdir)
// defer os.RemoveAll(unpdir)
fmt.Printf("\033[1000D \033[48;5;22m:Unpacking [%v/%v]\033[0m [%v%v]", i+1, len(pth), strings.Repeat("#", i+1), strings.Repeat(".", len(pth)-i-1))
}
fmt.Printf("\n")
Expand Down

0 comments on commit 3e4873d

Please sign in to comment.