File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed
Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @guidepup/setup" ,
3- "version" : " 0.12.1 " ,
3+ "version" : " 0.13.0 " ,
44 "description" : " Setup your environment for screen-reader automation." ,
55 "main" : " lib/index.js" ,
66 "typings" : " lib/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { disableSplashScreenSystemDefaults } from "./disableSplashScreenSystemDe
44import { disableDictationInputAutoEnable } from "./disableDictationInputAutoEnable" ;
55import { isSipEnabled } from "./isSipEnabled" ;
66import { writeDatabaseFile } from "./writeDatabaseFile" ;
7- import { updateTccDb } from "./updateTccDb" ;
7+ import { SYSTEM_PATH , USER_PATH , updateTccDb } from "./updateTccDb" ;
88import { isAppleScriptControlEnabled } from "./isAppleScriptControlEnabled" ;
99import { askUserToControlUi } from "./askUserToControlUi" ;
1010import { setVoiceOverEnabledViaUi } from "./setVoiceOverEnabledViaUi" ;
@@ -19,13 +19,19 @@ const isRecorded = process.argv.includes("--record");
1919
2020export async function setup ( ) : Promise < void > {
2121 try {
22- updateTccDb ( ) ;
22+ updateTccDb ( USER_PATH ) ;
2323 } catch ( e ) {
2424 if ( isCi ) {
2525 throw e ;
2626 }
2727 }
2828
29+ try {
30+ updateTccDb ( SYSTEM_PATH ) ;
31+ } catch {
32+ // Swallow error - most CI don't allow system configuration
33+ }
34+
2935 const stopRecording = isRecorded
3036 ? record ( `./recordings/macos-setup-${ + new Date ( ) } .mov` )
3137 : ( ) => null ;
Original file line number Diff line number Diff line change @@ -206,9 +206,10 @@ const getEntries = (): string[] => {
206206 ] ;
207207} ;
208208
209- const path = "$HOME/Library/Application Support/com.apple.TCC/TCC.db" ;
209+ export const USER_PATH = "$HOME/Library/Application Support/com.apple.TCC/TCC.db" ;
210+ export const SYSTEM_PATH = "/Library/Application Support/com.apple.TCC/TCC.db" ;
210211
211- export function updateTccDb ( ) : void {
212+ export function updateTccDb ( path : string ) : void {
212213 for ( const values of getEntries ( ) ) {
213214 const query = `INSERT OR IGNORE INTO access VALUES(${ values } );` ;
214215
You can’t perform that action at this time.
0 commit comments