mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Format for the sqlite3 databse used for the assistive information changed in Mojave, additional columns added.
This commit is contained in:
parent
9c8a7e6a26
commit
9767dddfbf
1 changed files with 7 additions and 2 deletions
|
@ -55,11 +55,16 @@ def install(app_id, enable=True):
|
|||
salt '*' assistive.install com.smileonmymac.textexpander
|
||||
'''
|
||||
ge_el_capitan = True if _LooseVersion(__grains__['osrelease']) >= salt.utils.stringutils.to_str('10.11') else False
|
||||
ge_mojave = True if _LooseVersion(__grains__['osrelease']) >= salt.utils.stringutils.to_str('10.14') else False
|
||||
client_type = _client_type(app_id)
|
||||
enable_str = '1' if enable else '0'
|
||||
cmd = 'sqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" ' \
|
||||
'"INSERT or REPLACE INTO access VALUES(\'kTCCServiceAccessibility\',\'{0}\',{1},{2},1,NULL{3})"'.\
|
||||
format(app_id, client_type, enable_str, ',NULL' if ge_el_capitan else '')
|
||||
'"INSERT or REPLACE INTO access VALUES(\'kTCCServiceAccessibility\',\'{0}\',{1},{2},1,NULL{3}{4})"'.\
|
||||
format(app_id,
|
||||
client_type,
|
||||
enable_str,
|
||||
',NULL' if ge_el_capitan else '',
|
||||
",NULL,NULL,NULL,NULL,''" if ge_mojave else '')
|
||||
|
||||
call = __salt__['cmd.run_all'](
|
||||
cmd,
|
||||
|
|
Loading…
Add table
Reference in a new issue