summaryrefslogtreecommitdiffstats
path: root/src/main/distrib
diff options
context:
space:
mode:
authorFlorian Zschocke <f.zschocke+git@gmail.com>2021-07-21 09:54:27 +0200
committerFlorian Zschocke <f.zschocke+git@gmail.com>2021-07-21 19:33:42 +0200
commit159f7fcf759a4d779d50173c6aa866915fb60a62 (patch)
tree7a434c92c07a6e3b30c5b9ff2c32d0495d8ea5e7 /src/main/distrib
parentd42411430114374bde004f38dae506704ceb3d3f (diff)
downloadgitblit-159f7fcf759a4d779d50173c6aa866915fb60a62.tar.gz
gitblit-159f7fcf759a4d779d50173c6aa866915fb60a62.zip
Set local variable visibility in batch scripts
Use SETLOCAL in batch scripts to restrict the visibility of variables that are set in the script to the script execution. Otherwise the variables will also be set in the calling shell. That is not a problem when a script is executed by double clicking it in Windows Explorer. But now that the scripts are changed so that they can be called on the command line from other folders, they should also no clutter the calling environment.
Diffstat (limited to 'src/main/distrib')
-rw-r--r--src/main/distrib/win/add-indexed-branch.cmd2
-rw-r--r--src/main/distrib/win/installService.cmd5
-rw-r--r--src/main/distrib/win/uninstallService.cmd3
3 files changed, 9 insertions, 1 deletions
diff --git a/src/main/distrib/win/add-indexed-branch.cmd b/src/main/distrib/win/add-indexed-branch.cmd
index af540777..25b46383 100644
--- a/src/main/distrib/win/add-indexed-branch.cmd
+++ b/src/main/distrib/win/add-indexed-branch.cmd
@@ -14,9 +14,11 @@
@REM Set BRANCH ("default" or fully qualified ref - i.e. refs/heads/master)
@REM Set EXCLUSIONS for any repositories that you do not want to change
@REM --------------------------------------------------------------------------
+@SETLOCAL
@SET FOLDER=data/git
@SET EXCLUSIONS=--skip test.git --skip group/test*
@SET BRANCH=default
@PUSHD %~dp0
@java -cp gitblit.jar;"%CD%\ext\*" com.gitblit.AddIndexedBranch --repositoriesFolder %FOLDER% --branch %BRANCH% %EXCLUSIONS% %*
@POPD
+@ENDLOCAL
diff --git a/src/main/distrib/win/installService.cmd b/src/main/distrib/win/installService.cmd
index 532c63cd..23d45a46 100644
--- a/src/main/distrib/win/installService.cmd
+++ b/src/main/distrib/win/installService.cmd
@@ -8,6 +8,8 @@
@REM
@REM http://commons.apache.org/daemon/procrun.html
+@SETLOCAL
+
@REM arch = x86, amd64, or ia32
SET ARCH=amd64
@@ -38,4 +40,5 @@ SET ARCH=amd64
--Classpath="%gbhome%\gitblit.jar;%gbhome%\ext\*" ^
--Jvm=auto ^
--JvmMx=1024
- \ No newline at end of file
+
+@ENDLOCAL
diff --git a/src/main/distrib/win/uninstallService.cmd b/src/main/distrib/win/uninstallService.cmd
index a32007e8..6a574d19 100644
--- a/src/main/distrib/win/uninstallService.cmd
+++ b/src/main/distrib/win/uninstallService.cmd
@@ -1,6 +1,9 @@
+@SETLOCAL
@REM arch = x86, amd64, or ia32
SET ARCH=amd64
@REM Delete the gitblit service
"%~dp0%ARCH%\gitblit.exe" //DS//gitblit
+
+@ENDLOCAL