Skip to content

Commit

Permalink
Follow-up to PR #690 to check chrome_pref before hacking (#699)
Browse files Browse the repository at this point in the history
* check chrome_pref before hacking

* pipe to nul for access denied error
  • Loading branch information
kensoh authored Feb 3, 2020
1 parent 5a07c4c commit 47b2def
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tagui.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -728,8 +728,10 @@ if not exist "tagui_logging" (

rem hack chrome to prevent ended unexpectedly message
set "chrome_pref=%LOCALAPPDATA%\Google\Chrome\User Data\Default"
gawk "sub(\"\\\"exited_cleanly\\\":false\", \"\\\"exited_cleanly\\\":true\")" "%chrome_pref%" > "%chrome_pref%"
gawk "sub(\"\\\"exit_type\\\":\\\"Crashed\\\"\", \"\\\"exit_type\\\":\\\"Normal\\\"\")" "%chrome_pref%" > "%chrome_pref%"
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
)

rem change back to initial directory where tagui is called
cd /d "%initial_dir%"
Expand Down

0 comments on commit 47b2def

Please sign in to comment.