Skip to content

Commit 7313b75

Browse files
committed
add :abspath
1 parent a8815a0 commit 7313b75

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

modules/files.cmd

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ call :%* ""
77
goto :eof
88

99

10+
:abspath <RELATIVE_PATH> [<RESULT_VAR>]
11+
setlocal
12+
set abs_path=%~f1
13+
set result_var=%~2
14+
if "%result_var%" == "" (
15+
echo %abs_path%
16+
exit /B 0
17+
)
18+
endlocal & set "%result_var%=%abs_path%"
19+
goto :eof
20+
21+
1022
:basename <PATH> [<RESULT_VAR>]
1123
setlocal
1224
set basename=%~nx1

0 commit comments

Comments
 (0)