You can use relative path .
with or without /d
(directory):
for %f in (.) // Obs.: by using "." you don't need "" in (".")
:: or...
for /d %f in (.) // Obs.: by using "." you don't need "" in (".")
In command line:
for %F in (.)do set "folder=%~nxF"
for /d %F in (.)do set "folder=%~nxF"
In .cmd/.bat file:
for %%F in (.)do set "folder=%%~nxF"
:: Or...
for %%F in (.)do git flow feature start "%%~nxF"
:: -----------------------------------------------
for /d %%F in (.)do set "folder=%%~nxF"
:: Or...
for /d %%F in (.)do git flow feature start "%%~nxF"
Or, you can concatenate /
to your path, replace \
to //
, also removing :
and without using the for
loop in one line
In command line or .cmd/.bat file
:: concatenate "\" + _current_path + removing ":" => : => /c\repo\3333-new-feature
set "_path=/%cd::=%"
:: replace any "\" in C:\repos\3333-new-feature to "/" => "\" => /c/repo/3333-new-feature
git flow feature start %_path:\=/%
:: the same in one line
set "_path=/%cd::=%" && cmd/v/c "git flow feature start !_path:\=/!"
:: the same in one line if any folder have space/special character, use dobblequotes in "path"
set "_path=/%cd::=%" && cmd /q /v /s /c "git flow feature start "!_path:\=/!""
:: in command line:
@set "_path=/%cd::=%" && cmd /q /v /s /r "@echo\git flow feature start %_path:\=/%"
You can also try directly using .
considering it is the current Directory:
git flow feature start .
cd /d "C:\repos\3333-new-feature" && git flow feature start .
/c/repo/3333-new-feature
, this is possible without usingfor
loop...