bugfix tar.gz packaging

This commit is contained in:
AJ ONeal 2019-08-09 22:26:54 -06:00
parent c927f0c6c6
commit 3ca47d18cd
1 changed files with 5 additions and 4 deletions

View File

@ -262,7 +262,7 @@ func main() {
} }
//fis, err := ioutil.ReadDir(npmdir) //fis, err := ioutil.ReadDir(npmdir)
fi, err := os.Stat(npmdir) fi, err := os.Stat(outdir)
if nil != err { if nil != err {
panic("stat:" + err.Error()) panic("stat:" + err.Error())
} }
@ -271,7 +271,7 @@ func main() {
case "zip": case "zip":
err = Zip(f, outdir, "") err = Zip(f, outdir, "")
if nil != err { if nil != err {
panic("tarError:" + err.Error()) panic("zipError:" + err.Error())
} }
case "tar.gz": case "tar.gz":
// Write out the tar // Write out the tar
@ -281,8 +281,9 @@ func main() {
tw := tar.NewWriter(zw) tw := tar.NewWriter(zw)
defer tw.Close() defer tw.Close()
//err = tarDir(tw, npmdir, fis, "") // TODO create Tar() in go-examples
err = tarEntry(tw, "", fi, npmdir) //err = tarDir(tw, outdir, fis, "")
err = tarEntry(tw, "", fi, outdir)
if nil != err { if nil != err {
panic("tarError:" + err.Error()) panic("tarError:" + err.Error())
} }