File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " @guidepup/setup" ,
3- "version" : " 0.24.0-alpha.5 " ,
3+ "version" : " 0.24.0-alpha.6 " ,
44 "description" : " CLI for configuring environments and install screen reader assets for Guidepup." ,
55 "main" : " lib/index.js" ,
66 "typings" : " lib/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -57,9 +57,11 @@ tell application "VoiceOver"
5757end tell` ;
5858
5959async function stopVoiceOver ( ) : Promise < void > {
60- await retryOnError ( ( ) => runAppleScript ( stopVoiceOverApplescript ) ) ;
61-
62- await new Promise ( ( resolve ) => setTimeout ( resolve , 100 ) ) ;
60+ try {
61+ await runAppleScript ( stopVoiceOverApplescript ) ;
62+ } catch {
63+ // Swallow
64+ }
6365
6466 try {
6567 execFileSync (
@@ -74,16 +76,9 @@ async function stopVoiceOver(): Promise<void> {
7476 // Swallow
7577 }
7678
77- await new Promise ( ( resolve ) => setTimeout ( resolve , 100 ) ) ;
78-
79- await retryOnError (
80- ( ) => {
81- if ( isRunning ( ) ) {
82- throw new Error ( ERR_SETUP_MACOS_UNABLE_TO_STOP_VOICEOVER ) ;
83- }
84- } ,
85- { retries : 10 , delay : 100 } ,
86- ) ;
79+ if ( isRunning ( ) ) {
80+ throw new Error ( ERR_SETUP_MACOS_UNABLE_TO_STOP_VOICEOVER ) ;
81+ }
8782}
8883
8984function preferencesExist ( localPlist : string ) : void {
@@ -120,5 +115,5 @@ export async function ensureLocalPreferencesExist(): Promise<void> {
120115 delay : 100 ,
121116 } ) ;
122117
123- await stopVoiceOver ( ) ;
118+ await retryOnError ( ( ) => stopVoiceOver ( ) , { retries : 10 , delay : 200 } ) ;
124119}
You can’t perform that action at this time.
0 commit comments