Skip to content

Commit 3592273

Browse files

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

certificates/certificates.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,14 @@ func GenerateCertificates(certsDir *paths.Path) {
267267
func InstallCertificates(certsDir *paths.Path) {
268268
switch runtime.GOOS {
269269
case "darwin":
270-
stdoutStderr, err := exec.Command("/usr/bin/osascript", "-e", `'do shell script \"security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain `+certsDir.String()+`/ca.cert.pem\" with administration privileges'`).CombinedOutput()
270+
command := fmt.Sprintf(`tell application "Terminal"
271+
reopen
272+
activate
273+
delay 1
274+
do script "sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain %s/ca.cert.pem; echo '\\nYou can now close this window.\\n\\n' ; exit" in front window
275+
end tell`, certsDir.String())
276+
log.Info("osascript", "-e", command)
277+
stdoutStderr, err := exec.Command("osascript", "-e", command).CombinedOutput()
271278
if err != nil {
272279
log.Errorf("cannot install certificate in the system keychain: %s", err)
273280
}

0 commit comments

Comments
 (0)