2018-03-23 22:20:07 +08:00
|
|
|
@echo off
|
|
|
|
|
|
|
|
call "%~dp0lib_base.cmd"
|
|
|
|
call "%%~dp0lib_console"
|
|
|
|
set lib_profile=call "%~dp0lib_profile.cmd"
|
|
|
|
|
|
|
|
if "%~1" == "/h" (
|
2018-05-31 20:35:02 +08:00
|
|
|
%lib_base% help "%~0"
|
2018-03-23 22:20:07 +08:00
|
|
|
) else if "%1" neq "" (
|
|
|
|
call :%*
|
|
|
|
)
|
|
|
|
|
|
|
|
exit /b
|
|
|
|
|
|
|
|
:::===============================================================================
|
2024-10-14 19:10:21 +08:00
|
|
|
:::run_profile_d - Run all scripts in the passed directory path
|
|
|
|
:::.
|
2018-03-23 22:20:07 +08:00
|
|
|
:::include:
|
2024-10-14 19:10:21 +08:00
|
|
|
:::.
|
2018-05-31 20:35:02 +08:00
|
|
|
::: call "lib_profile.cmd"
|
2024-10-14 19:10:21 +08:00
|
|
|
:::.
|
2018-03-23 22:20:07 +08:00
|
|
|
:::usage:
|
2024-10-14 19:10:21 +08:00
|
|
|
:::.
|
2018-03-23 22:20:07 +08:00
|
|
|
::: %lib_profile% "[dir_path]"
|
2024-10-14 19:10:21 +08:00
|
|
|
:::.
|
2018-03-23 22:20:07 +08:00
|
|
|
:::required:
|
2024-10-14 19:10:21 +08:00
|
|
|
:::.
|
2018-03-23 22:20:07 +08:00
|
|
|
::: [dir_path] <in> Fully qualified directory path containing init *.cmd|*.bat.
|
|
|
|
::: Example: "c:\bin"
|
2024-10-14 19:10:21 +08:00
|
|
|
:::.
|
2018-03-23 22:20:07 +08:00
|
|
|
::: path <out> Sets the path env variable if required.
|
|
|
|
:::-------------------------------------------------------------------------------
|
|
|
|
|
2024-10-14 19:10:21 +08:00
|
|
|
:run_profile_d
|
2022-11-06 16:07:58 +08:00
|
|
|
if not exist "%~1" (
|
|
|
|
mkdir "%~1"
|
|
|
|
)
|
2018-03-23 22:20:07 +08:00
|
|
|
|
2022-11-06 16:07:58 +08:00
|
|
|
pushd "%~1"
|
|
|
|
for /f "usebackq" %%x in ( `dir /b *.bat *.cmd 2^>nul` ) do (
|
|
|
|
%print_verbose% "Calling '%~1\%%x'..."
|
|
|
|
call "%~1\%%x"
|
|
|
|
)
|
|
|
|
popd
|
|
|
|
exit /b
|