소스 검색

handle failing dscl

Eugene Pankov 4 년 전
부모
커밋
a1dbcdbae3
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      app/lib/app.ts

+ 5 - 1
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()