From 365e76bc9f2c9bf30509ce5f1aec6627ad84c84b Mon Sep 17 00:00:00 2001 From: junoslukan Date: Sun, 13 Nov 2022 14:37:26 +0000 Subject: [PATCH] Format date and time consistently. (#1580) * Format date and time consistently. Co-authored-by: junos Co-authored-by: earthlng --- prefsCleaner.bat | 11 +++++++---- updater.bat | 9 +++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/prefsCleaner.bat b/prefsCleaner.bat index 616ec28..7591c0e 100644 --- a/prefsCleaner.bat +++ b/prefsCleaner.bat @@ -3,7 +3,7 @@ TITLE prefs.js cleaner REM ### prefs.js cleaner for Windows REM ## author: @claustromaniac -REM ## version: 2.4 +REM ## version: 2.5 CD /D "%~dp0" @@ -13,7 +13,7 @@ ECHO: ECHO ######################################## ECHO #### prefs.js cleaner for Windows #### ECHO #### by claustromaniac #### -ECHO #### v2.4 #### +ECHO #### v2.5 #### ECHO ######################################## ECHO: CALL :message "This script should be run from your Firefox profile directory." @@ -30,9 +30,12 @@ IF NOT EXIST "user.js" (CALL :abort "user.js not found in the current directory. IF NOT EXIST "prefs.js" (CALL :abort "prefs.js not found in the current directory." 30) CALL :strlenCheck CALL :FFcheck + CALL :message "Backing up prefs.js..." -SET "_time=%time: =0%" -COPY /B /V /Y prefs.js "prefs-backup-%date:/=-%_%_time::=.%.js" +FOR /F "usebackq tokens=1,2 delims==" %%i IN (`wmic os get LocalDateTime /VALUE 2^>NUL`) DO IF '.%%i.'=='.LocalDateTime.' SET ldt=%%j +SET ldt=%ldt:~0,8%_%ldt:~8,6% +COPY /B /V /Y prefs.js "prefs-backup-%ldt%.js" + CALL :message "Cleaning prefs.js..." CALL :cleanup CALL :message "All done!" diff --git a/updater.bat b/updater.bat index eef06f0..83499c2 100644 --- a/updater.bat +++ b/updater.bat @@ -3,10 +3,10 @@ TITLE arkenfox user.js updater REM ## arkenfox user.js updater for Windows REM ## author: @claustromaniac -REM ## version: 4.16 +REM ## version: 4.17 REM ## instructions: https://github.com/arkenfox/user.js/wiki/5.1-Updater-[Options]#-windows -SET v=4.15 +SET v=4.17 VERIFY ON CD /D "%~dp0" @@ -177,8 +177,9 @@ IF EXIST user.js.new ( IF DEFINED _singlebackup ( MOVE /Y user.js user.js.bak >nul ) ELSE ( - SET "_time=!time: =0!" - MOVE /Y user.js "user-backup-!date:/=-!_!_time::=.!.js" >nul + FOR /F "usebackq tokens=1,2 delims==" %%i IN (`wmic os get LocalDateTime /VALUE 2^>NUL`) DO IF '.%%i.'=='.LocalDateTime.' SET ldt=%%j + SET ldt=%ldt:~0,8%_%ldt:~8,6% + MOVE /Y user.js "user-backup-%ldt%.js" >nul ) REN user.js.new user.js CALL :message "Update complete."