Fixed issue with reading/writing resources to and from to incorrect path
This commit is contained in:
bradley.richins
2020-10-19 12:02:58 -06:00
parent 897327dc50
commit 76fb306965
2 changed files with 57 additions and 6 deletions

View File

@@ -35,7 +35,7 @@ func CreateBanner(portalhex string, savename string, vopt int) {
}
// assign image location of its glyph hex value to an array of strings
for j := 0; j < len(glyphImg); j++ {
glyphImg[j] = fmt.Sprintf("glyphs/GLYPH-%X.png", GlyphHex[j])
glyphImg[j] = fmt.Sprintf("tmp.nmslib/glyphs/GLYPH-%X.png", GlyphHex[j])
}
// pull images need from glyph.go and saved them to ./glyphs/
for k := 0; k < len(glyphImg); k++ {
@@ -43,9 +43,9 @@ func CreateBanner(portalhex string, savename string, vopt int) {
if err != nil {
panic(err)
}
_, err2 := os.Stat("glyphs")
_, err2 := os.Stat("tmp.nmslib/glyphs")
if os.IsNotExist(err2) {
errDir := os.MkdirAll("glyphs", 0755)
errDir := os.MkdirAll("tmp.nmslib/glyphs", 0755)
if errDir != nil {
panic(errDir)
}
@@ -84,7 +84,7 @@ func CreateBanner(portalhex string, savename string, vopt int) {
err = png.Encode(file, rgba)
}
// remove glyphs folder to keep it clean
errDir := os.RemoveAll("glyphs")
errDir := os.RemoveAll("tmp.nmslib/glyphs")
if errDir != nil {
panic(errDir)
}