wails-release/internal/archive/archive.go
Leon Mika 1acf07af16 Add ditto archive helper
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 10:09:40 +10:00

23 lines
554 B
Go

package archive
import (
"context"
"fmt"
"github.com/leonmika/wails-release/internal/runner"
)
// ZipApp wraps a .app bundle into a .app.zip via ditto, preserving
// extended attributes and producing an archive Apple's notary service
// will accept.
func ZipApp(ctx context.Context, r runner.Runner, app, zipPath string) error {
_, err := r.Run(ctx, runner.Spec{
Name: "ditto",
Args: []string{"-c", "-k", "--keepParent", app, zipPath},
})
if err != nil {
return fmt.Errorf("ditto archive %s -> %s: %w", app, zipPath, err)
}
return nil
}