Files
2025-11-17 15:58:50 +08:00

32 lines
609 B
Go

package bundle
import (
"os"
"github.com/langgenius/dify-plugin-daemon/pkg/utils/log"
)
func PackageBundle(bundlePath string, outputPath string) {
packager, err := loadBundlePackager(bundlePath)
if err != nil {
log.Error("Failed to load bundle packager: %v", err)
os.Exit(1)
return
}
zipFile, err := packager.Export()
if err != nil {
log.Error("Failed to export bundle: %v", err)
os.Exit(1)
return
}
if err := os.WriteFile(outputPath, zipFile, 0644); err != nil {
log.Error("Failed to write zip file: %v", err)
os.Exit(1)
return
}
log.Info("Successfully packaged bundle")
}