-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy patha.bat
23 lines (18 loc) · 822 Bytes
/
a.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
@echo off
:: Copyright (c) 2017 Denis Kuzmin <x-3F@outlook.com> github/3F
:: Part of https://github.com/3F/hMSBuild
if "%~1"=="" echo Empty function name & exit /B 1
if exist GetNuTool\a.bat ( set "base0=GetNuTool\a" ) else if exist ..\GetNuTool\a.bat ( set "base0=..\GetNuTool\a" ) else if exist ..\GetNuTool\tests\a.bat ( set "base0=..\GetNuTool\tests\a" ) else (
echo GetNuTool's functions are not found & exit /B 1
)
if not defined G_LevelChild set /a G_LevelChild=1
if "%~1"=="tryThisOrBase" ( call %base0% shiftArgs 4,99 shArgs %* ) else set shArgs=%*
:: TODO: (performance) reduce the number of interruptions
call :!shArgs! 2>%~nx0.err
call %base0% tryThisOrBase !ERRORLEVEL! %~nx0.err !shArgs!
exit /B !ERRORLEVEL!
:: = = = = = = = = = = = = = = =
:rsrvHMS1
exit /B 0
:rsrvHMS2
exit /B 1