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:
parent
435aa99656
commit
772f0215a6
@ -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)
|
||||||
|
@ -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?
|
||||||
|
Loading…
Reference in New Issue
Block a user