1
1
Fork 0
mirror of https://github.com/arkenfox/user.js.git synced 2024-05-28 06:26:08 +02:00

convert to CRLF on the fly

MORE also converts TABs to spaces, by default to 8 but I changed it to 4
This commit is contained in:
earthlng 2017-12-18 16:01:46 +01:00 committed by GitHub
parent 1789fd902b
commit 1571e067e7
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,7 @@ TITLE ghacks user.js updater
REM ### ghacks-user.js updater for Windows
REM ## author: @claustromaniac
REM ## version: 4.0
REM ## version: 4.1
SET _myname=%~n0
SET _myparams=%*
@ -40,9 +40,11 @@ IF DEFINED _updateb (
REM Uncomment the next line and comment the powershell call for testing.
REM COPY /B /V /Y "!_myname!.bat" "[updated]!_myname!.bat"
(
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://github.com/ghacksuserjs/ghacks-user.js/raw/master/updater.bat', '[updated]!_myname!.bat')"
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://github.com/ghacksuserjs/ghacks-user.js/raw/master/updater.bat', '[updated]!_myname!.new')"
) >nul 2>&1
IF EXIST "[updated]!_myname!.bat" (
IF EXIST "[updated]!_myname!.new" (
TYPE "[updated]!_myname!.new" | MORE /E /P /T4 > "[updated]!_myname!.bat"
DEL /F "[updated]!_myname!.new" >nul
START /min CMD /C "[updated]!_myname!.bat" !_myparams!
EXIT /B
) ELSE (
@ -75,7 +77,7 @@ ECHO:
ECHO: ########################################
ECHO: #### user.js Updater for Windows ####
ECHO: #### by claustromaniac ####
ECHO: #### v4.0 ####
ECHO: #### v4.1 ####
ECHO: ########################################
ECHO:
SET /A "_line=0"