From a1dbcdbae3b1d17c914bbc04a5a8b762c1e29b94 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Sat, 13 Nov 2021 19:04:30 +0100 Subject: [PATCH] handle failing dscl --- app/lib/app.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/lib/app.ts b/app/lib/app.ts index f3788089..124e2ebe 100644 --- a/app/lib/app.ts +++ b/app/lib/app.ts @@ -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()