strip plugin path from zipped files

This commit is contained in:
idk
2021-06-25 19:35:09 -04:00
parent 784d67a138
commit a7e468538a
2 changed files with 4 additions and 3 deletions

View File

@ -147,6 +147,7 @@ func createZip() error {
walker := func(path string, info os.FileInfo, err error) error {
fmt.Printf("Crawling: %#v\n", path)
zippath := strings.Replace(path, "plugin/", "", 1)
if err != nil {
return err
}
@ -159,7 +160,7 @@ func createZip() error {
}
defer file.Close()
f, err := w.Create(path)
f, err := w.Create(zippath)
if err != nil {
return err
}
@ -178,7 +179,7 @@ func createZip() error {
func createSu3() (*su3.File, error) {
su3File := su3.New()
su3File.FileType = su3.FileTypeZIP
su3File.ContentType = su3.ContentTypeReseed
su3File.ContentType = su3.ContentTypePlugin
err := createZip()
if err != err {

View File

@ -79,7 +79,7 @@ func (pc *PluginConfig) PrintPluginName() string {
}
func (pc *PluginConfig) PrintKeyName() string {
if pc.KeyName == nil {
return fmt.Sprintf("key=%s\n", "")
return ""
}
return fmt.Sprintf("key=%s\n", *pc.KeyName)
}