Files
etcher/lib/shared/sudo/sudo-askpass.osascript-en.js
Edwin Joassart b3e33824ed patch: switch api; use ws; integrate sudo-prompt
- switch api roles flow
- use websocket instead of node-ipc
- integrate; modernize; simplify and deprecate sudo-prompt
2024-04-23 11:44:10 +02:00

22 lines
490 B
JavaScript
Executable File

#!/usr/bin/env osascript -l JavaScript
ObjC.import('stdlib')
const app = Application.currentApplication()
app.includeStandardAdditions = true
const result = app.displayDialog('balenaEtcher needs privileged access in order to flash disks.\n\nType your password to allow this.', {
defaultAnswer: '',
withIcon: 'caution',
buttons: ['Cancel', 'Ok'],
defaultButton: 'Ok',
hiddenAnswer: true,
})
if (result.buttonReturned === 'Ok') {
result.textReturned
} else {
$.exit(255)
}