diff --git a/v2/pkg/commands/bindings/bindings.go b/v2/pkg/commands/bindings/bindings.go index 310b1e9af..6ed2a27ba 100644 --- a/v2/pkg/commands/bindings/bindings.go +++ b/v2/pkg/commands/bindings/bindings.go @@ -57,6 +57,14 @@ func GenerateBindings(options Options) (string, error) { return stdout, fmt.Errorf("%s\n%s\n%s", stdout, stderr, err) } + if runtime.GOOS == "darwin" { + // Remove quarantine attribute + stdout, stderr, err = shell.RunCommand(workingDirectory, "xattr", "-rc", filename) + if err != nil { + return stdout, fmt.Errorf("%s\n%s\n%s", stdout, stderr, err) + } + } + defer func() { // Best effort removal of temp file _ = os.Remove(filename) diff --git a/v2/pkg/commands/build/build.go b/v2/pkg/commands/build/build.go index 62c08e910..d061f2ce0 100644 --- a/v2/pkg/commands/build/build.go +++ b/v2/pkg/commands/build/build.go @@ -321,6 +321,20 @@ func execBuildApplication(builder Builder, options *Options) (string, error) { } } + if runtime.GOOS == "darwin" { + // Remove quarantine attribute + if _, err := os.Stat(options.CompiledBinary); os.IsNotExist(err) { + return "", fmt.Errorf("compiled binary does not exist at path: %s", options.CompiledBinary) + } + stdout, stderr, err := shell.RunCommand(options.BinDirectory, "xattr", "-rc", options.CompiledBinary) + if err != nil { + return "", fmt.Errorf("%s - %s", err.Error(), stderr) + } + if options.Verbosity == VERBOSE && stdout != "" { + pterm.Info.Println(stdout) + } + } + pterm.Println("Done.") // Do we need to pack the app for non-windows?