Skip to content

Commit

Permalink
chrome hack on windows using php - fix and more robust (#735)
Browse files Browse the repository at this point in the history
* chrome hack on windows using php

* change quotation marks used to work on Windows
  • Loading branch information
kensoh authored Mar 2, 2020
1 parent edeea92 commit 5e719c0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tagui.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -1132,10 +1132,10 @@ if not exist "tagui_logging" (
)

rem hack chrome to prevent ended unexpectedly message
set "chrome_pref=%LOCALAPPDATA%\Google\Chrome\User Data\Default"
set "chrome_pref=chrome\tagui_user_profile\Default\Preferences"
if exist "%chrome_pref%" (
gawk "sub(\"\\\"exited_cleanly\\\":false\", \"\\\"exited_cleanly\\\":true\")" "%chrome_pref%" > "%chrome_pref%" > nul 2>&1
gawk "sub(\"\\\"exit_type\\\":\\\"Crashed\\\"\", \"\\\"exit_type\\\":\\\"Normal\\\"\")" "%chrome_pref%" > "%chrome_pref%" > nul 2>&1
php -q -r "file_put_contents('%chrome_pref%',str_replace('\"exited_cleanly\":false','\"exited_cleanly\":true',file_get_contents('%chrome_pref%')));" > nul 2>&1
php -q -r "file_put_contents('%chrome_pref%',str_replace('\"exit_type\":\"Crashed\"','\"exit_type\":\"Normal\"',file_get_contents('%chrome_pref%')));" > nul 2>&1
)

rem change back to initial directory where tagui is called
Expand Down

0 comments on commit 5e719c0

Please sign in to comment.