From df899bac55125dadc16d398e1ccaaab33d57c6f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morva=20Krist=C3=B3f?= Date: Fri, 5 Jan 2018 14:08:26 +0100 Subject: [PATCH] Fixing batch file line endings --- installers/windows/update_path.bat | 84 +++++++++++++++--------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/installers/windows/update_path.bat b/installers/windows/update_path.bat index 57a085bcc5..7f6753a7bb 100644 --- a/installers/windows/update_path.bat +++ b/installers/windows/update_path.bat @@ -1,42 +1,42 @@ -@echo off -setlocal EnableExtensions EnableDelayedExpansion - -if [%1] == [] ( - goto :usage -) - -if [%2] == [] ( - goto :usage -) - - -set TARGET_PATH=%2 %3 %4 %5 %6 %7 %8 %9 - -:: Remove trailing spaces -for /f "tokens=* delims= " %%a in ("!TARGET_PATH!") do set "TARGET_PATH=%%a" -for /l %%a in (1,1,100) do if "!TARGET_PATH:~-1!"==" " set "TARGET_PATH=!TARGET_PATH:~0,-1!" - -:: Remove trailing ; if any -if "%PATH:~-1%"==";" ( - set PATH=!PATH:~0,-1! -) - -if "%1" == "add" ( - set "PATH=!PATH!;%TARGET_PATH%" - goto :update -) - -if "%1" == "remove" ( - set "PATH=!PATH:;%TARGET_PATH%=!" - goto :update -) - -:usage -echo Script to add or remove to path environment variable -echo Usage: -echo %0 [add^|remove] path -exit /b 1 - -:update - -call Setx PATH "!PATH!" /m +@echo off +setlocal EnableExtensions EnableDelayedExpansion + +if [%1] == [] ( + goto :usage +) + +if [%2] == [] ( + goto :usage +) + + +set TARGET_PATH=%2 %3 %4 %5 %6 %7 %8 %9 + +:: Remove trailing spaces +for /f "tokens=* delims= " %%a in ("!TARGET_PATH!") do set "TARGET_PATH=%%a" +for /l %%a in (1,1,100) do if "!TARGET_PATH:~-1!"==" " set "TARGET_PATH=!TARGET_PATH:~0,-1!" + +:: Remove trailing ; if any +if "%PATH:~-1%"==";" ( + set PATH=!PATH:~0,-1! +) + +if "%1" == "add" ( + set "PATH=!PATH!;%TARGET_PATH%" + goto :update +) + +if "%1" == "remove" ( + set "PATH=!PATH:;%TARGET_PATH%=!" + goto :update +) + +:usage +echo Script to add or remove to path environment variable +echo Usage: +echo %0 [add^|remove] path +exit /b 1 + +:update + +call Setx PATH "!PATH!" /m