mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-29 06:06:33 +00:00
22 lines
490 B
JavaScript
Executable File
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)
|
|
}
|
|
|