handle failing dscl

This commit is contained in:
Eugene Pankov 2021-11-13 19:04:30 +01:00
parent 92f5b5a4ae
commit a1dbcdbae3
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -54,7 +54,11 @@ export class Application {
})
;(promiseIpc as any).on('get-default-mac-shell', async () => {
return (await exec(`/usr/bin/dscl . -read /Users/${process.env.LOGNAME} UserShell`))[0].toString().split(' ')[1].trim()
try {
return (await exec(`/usr/bin/dscl . -read /Users/${process.env.LOGNAME} UserShell`))[0].toString().split(' ')[1].trim()
} catch {
return '/bin/bash'
}
})
const configData = loadConfig()