mirror of
https://github.com/cmderdev/cmder.git
synced 2025-06-16 22:57:49 +08:00
Made all sub-routines in init.bat importable libs (#1706)
This commit is contained in:
46
vendor/lib/lib_profile.cmd
vendored
Normal file
46
vendor/lib/lib_profile.cmd
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
@echo off
|
||||
|
||||
|
||||
call "%~dp0lib_base.cmd"
|
||||
call "%%~dp0lib_console"
|
||||
set lib_profile=call "%~dp0lib_profile.cmd"
|
||||
|
||||
if "%~1" == "/h" (
|
||||
%lib_base% help "%0"
|
||||
) else if "%1" neq "" (
|
||||
call :%*
|
||||
)
|
||||
|
||||
exit /b
|
||||
|
||||
:run_profile_d
|
||||
:::===============================================================================
|
||||
:::run_profile_d - Run all scripts in the passed dir path
|
||||
:::
|
||||
:::include:
|
||||
:::
|
||||
::: call "$0"
|
||||
:::
|
||||
:::usage:
|
||||
:::
|
||||
::: %lib_profile% "[dir_path]"
|
||||
:::
|
||||
:::required:
|
||||
:::
|
||||
::: [dir_path] <in> Fully qualified directory path containing init *.cmd|*.bat.
|
||||
::: Example: "c:\bin"
|
||||
:::
|
||||
::: path <out> Sets the path env variable if required.
|
||||
:::-------------------------------------------------------------------------------
|
||||
|
||||
if not exist "%~1" (
|
||||
mkdir "%~1"
|
||||
)
|
||||
|
||||
pushd "%~1"
|
||||
for /f "usebackq" %%x in ( `dir /b *.bat *.cmd 2^>nul` ) do (
|
||||
%lib_console% verbose-output "Calling '%~1\%%x'..."
|
||||
call "%~1\%%x"
|
||||
)
|
||||
popd
|
||||
exit /b
|
Reference in New Issue
Block a user