5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 23:51:44 +08:00

Remove quarantine attribute from bindings + compiled binary (#3118)

* Remove quarantine attribute from bindings + compiled binary

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Lea Anthony 2023-12-15 20:26:30 +11:00 committed by GitHub
parent 435aa99656
commit 772f0215a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View File

@ -57,6 +57,14 @@ func GenerateBindings(options Options) (string, error) {
return stdout, fmt.Errorf("%s\n%s\n%s", stdout, stderr, err) 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() { defer func() {
// Best effort removal of temp file // Best effort removal of temp file
_ = os.Remove(filename) _ = os.Remove(filename)

View File

@ -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.") pterm.Println("Done.")
// Do we need to pack the app for non-windows? // Do we need to pack the app for non-windows?