mirror of
https://github.com/arkenfox/user.js.git
synced 2024-10-01 01:35:52 -04:00
Fixed issue with commented-out user_pref lines
It ended up being a mixture of the previous commit and the fix. It writes a temporary file on the go that only holds preferences, and generates the target file at once at the end. It's slower than before, but it works.
This commit is contained in:
parent
635cacfe54
commit
3737b65f53
14
updater.bat
14
updater.bat
@ -207,8 +207,8 @@ EXIT /B
|
|||||||
|
|
||||||
REM ###### Merge function ######
|
REM ###### Merge function ######
|
||||||
:merge
|
:merge
|
||||||
DEL /F %2 2>nul
|
|
||||||
SETLOCAL disabledelayedexpansion
|
SETLOCAL disabledelayedexpansion
|
||||||
|
(
|
||||||
FOR /F "tokens=1,* delims=]" %%G IN ('find /n /v "" ^< "%~1"') DO (
|
FOR /F "tokens=1,* delims=]" %%G IN ('find /n /v "" ^< "%~1"') DO (
|
||||||
SET "_pref=%%H"
|
SET "_pref=%%H"
|
||||||
SETLOCAL enabledelayedexpansion
|
SETLOCAL enabledelayedexpansion
|
||||||
@ -219,7 +219,7 @@ FOR /F "tokens=1,* delims=]" %%G IN ('find /n /v "" ^< "%~1"') DO (
|
|||||||
SET "_pref=%%S"
|
SET "_pref=%%S"
|
||||||
)
|
)
|
||||||
SET _pref=!_pref:"=""!
|
SET _pref=!_pref:"=""!
|
||||||
FIND /I "!_pref!" %~2 >nul 2>&1
|
FIND /I "!_pref!" updatertempfile1 >nul 2>&1
|
||||||
IF ERRORLEVEL 1 (
|
IF ERRORLEVEL 1 (
|
||||||
FOR /F "tokens=* delims=" %%X IN ('FIND /I "!_pref!" %~1') DO (
|
FOR /F "tokens=* delims=" %%X IN ('FIND /I "!_pref!" %~1') DO (
|
||||||
SET "_temp=%%X"
|
SET "_temp=%%X"
|
||||||
@ -228,17 +228,19 @@ FOR /F "tokens=1,* delims=]" %%G IN ('find /n /v "" ^< "%~1"') DO (
|
|||||||
SET "_pref=%%X"
|
SET "_pref=%%X"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
ECHO(!_pref!>>%~2
|
ECHO(!_pref!
|
||||||
|
ECHO(!_pref!>>updatertempfile1
|
||||||
)
|
)
|
||||||
) ELSE (
|
) ELSE (
|
||||||
ECHO(!_pref!>>%~2
|
ECHO(!_pref!
|
||||||
)
|
)
|
||||||
) ELSE (
|
) ELSE (
|
||||||
ECHO(!_pref!>>%~2
|
ECHO(!_pref!
|
||||||
)
|
)
|
||||||
ENDLOCAL
|
ENDLOCAL
|
||||||
)
|
)
|
||||||
|
)>%~2
|
||||||
ENDLOCAL
|
ENDLOCAL
|
||||||
DEL /F %1 >nul
|
DEL /F %1 updatertempfile1 >nul
|
||||||
GOTO :EOF
|
GOTO :EOF
|
||||||
REM ############################
|
REM ############################
|
||||||
|
Loading…
Reference in New Issue
Block a user