From 3f18f812e3f105006483c4c3e8841641213fd1e3 Mon Sep 17 00:00:00 2001 From: Samuel Vasko Date: Sun, 8 Dec 2013 23:40:11 +0100 Subject: [PATCH] Generating path --- bin/pathgen.bat | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 bin/pathgen.bat diff --git a/bin/pathgen.bat b/bin/pathgen.bat new file mode 100644 index 0000000..06a9cd4 --- /dev/null +++ b/bin/pathgen.bat @@ -0,0 +1,28 @@ +:: This script checks for folders in \bin that contain executables +:: and adds them to PATH. It also adds all folders that match \bin\*\bin + +@echo off +setlocal EnableDelayedExpansion + +pushd %CD% +cd /d "%CMDER_ROOT%\bin" + +for /d %%D in (*) do ( + set hasexe= + :: Check for existence of folders with executables in \bin + if exist "%%D\*.exe" set hasexe=true + if exist "%%D\*.bat" set hasexe=true + if "!hasexe!" == "true" ( + set PATH=!PATH!;%CD%\%%D + ) + + :: Find all \bin\*\bin and also add them + if exist "%%D\bin" ( + set PATH=!PATH!;%CD%\%%D\bin + ) +) + +popd +endlocal & ( PATH = %PATH%;%CMDER_ROOT%\bin ) + +