mirror of
https://github.com/arkenfox/user.js.git
synced 2025-02-23 10:53:57 +00:00
replaced -multibackups with -singlebackup
also minor changes to the merge function.
This commit is contained in:
parent
c8d7694fd3
commit
4fb3040042
18
updater.bat
18
updater.bat
@ -16,7 +16,7 @@ IF /I "%~1"=="-logp" (SET _log=1 & SET _logp=1)
|
|||||||
IF /I "%~1"=="-multioverrides" (SET _multi=1)
|
IF /I "%~1"=="-multioverrides" (SET _multi=1)
|
||||||
IF /I "%~1"=="-merge" (SET _merge=1)
|
IF /I "%~1"=="-merge" (SET _merge=1)
|
||||||
IF /I "%~1"=="-updatebatch" (SET _updateb=1)
|
IF /I "%~1"=="-updatebatch" (SET _updateb=1)
|
||||||
IF /I "%~1"=="-multibackups" (SET _multibackups=1)
|
IF /I "%~1"=="-singlebackup" (SET _singlebackup=1)
|
||||||
SHIFT
|
SHIFT
|
||||||
GOTO parse
|
GOTO parse
|
||||||
:endparse
|
:endparse
|
||||||
@ -158,10 +158,10 @@ IF EXIST user.js.new (
|
|||||||
)
|
)
|
||||||
IF "!_changed!"=="true" (
|
IF "!_changed!"=="true" (
|
||||||
CALL :message "Backing up..."
|
CALL :message "Backing up..."
|
||||||
IF DEFINED _multibackups (
|
IF DEFINED _singlebackup (
|
||||||
MOVE /Y user.js "user-backup-!date:/=-!_!time::=.!.js" >nul
|
|
||||||
) ELSE (
|
|
||||||
MOVE /Y user.js user.js.bak >nul
|
MOVE /Y user.js user.js.bak >nul
|
||||||
|
) ELSE (
|
||||||
|
MOVE /Y user.js "user-backup-!date:/=-!_!time::=.!.js" >nul
|
||||||
)
|
)
|
||||||
REN user.js.new user.js
|
REN user.js.new user.js
|
||||||
CALL :message "Update complete."
|
CALL :message "Update complete."
|
||||||
@ -196,18 +196,14 @@ REM ############ Merge function ############
|
|||||||
:merge
|
:merge
|
||||||
SETLOCAL DisableDelayedExpansion
|
SETLOCAL DisableDelayedExpansion
|
||||||
(
|
(
|
||||||
FOR /F tokens^=2^,^*^ delims^=^'^" %%G IN ('FINDSTR /B /R /C:"user_pref.*\).*;" "%~1"') DO (
|
FOR /F tokens^=2^,^*^ delims^=^'^" %%G IN ('FINDSTR /B /R /C:"user_pref.*\)[ ]*;" "%~1"') DO (IF NOT "%%H"=="" (SET "%%G=%%H"))
|
||||||
IF NOT "%%G"=="" (
|
|
||||||
IF NOT "%%H"=="" (SET "%%G=%%H")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
FOR /F "tokens=1,* delims=:" %%I IN ('FINDSTR /N "^" "%~1"') DO (
|
FOR /F "tokens=1,* delims=:" %%I IN ('FINDSTR /N "^" "%~1"') DO (
|
||||||
SET "_temp=%%J"
|
SET "_temp=%%J"
|
||||||
SETLOCAL EnableDelayedExpansion
|
SETLOCAL EnableDelayedExpansion
|
||||||
IF "!_temp:)=!"=="!_temp!" (
|
IF NOT "!_temp:~0,9!"=="user_pref" (
|
||||||
ENDLOCAL & ECHO:%%J
|
ENDLOCAL & ECHO:%%J
|
||||||
) ELSE (
|
) ELSE (
|
||||||
IF NOT "!_temp:~0,9!"=="user_pref" (
|
IF "!_temp:;=!"=="!_temp!" (
|
||||||
ENDLOCAL & ECHO:%%J
|
ENDLOCAL & ECHO:%%J
|
||||||
) ELSE (
|
) ELSE (
|
||||||
ENDLOCAL
|
ENDLOCAL
|
||||||
|
Loading…
x
Reference in New Issue
Block a user