Skip to content

Commit 11edd3f

Browse files
committed
feature(windows): distribute modified batch files for windows use
Fixes #4.
1 parent 16e797f commit 11edd3f

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-0
lines changed

windows/j.bat

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@echo off
2+
setlocal EnableDelayedExpansion
3+
4+
echo %*|>nul findstr /rx \-.*
5+
if ERRORLEVEL 1 (
6+
for /f "delims=" %%i in ('"%~dp0\autojump" %*') do set new_path=%%i
7+
if exist !new_path!\nul (
8+
echo !new_path!
9+
pushd !new_path!
10+
REM endlocal is necessary so that we can change directory for outside of this script
11+
REM but will automatically popd. We mush pushd twice to work around this.
12+
pushd !new_path!
13+
endlocal
14+
popd
15+
) else (
16+
echo autojump: directory %* not found
17+
echo try `autojump --help` for more information
18+
)
19+
) else (
20+
"%~dp0\autojump" %*
21+
)

windows/jc.bat

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@echo off
2+
3+
echo %*|>nul findstr /rx \-.*
4+
if ERRORLEVEL 1 (
5+
"%~dp0\j.bat" "%cd%" %*
6+
) else (
7+
"%~dp0\autojump" %*
8+
)

windows/jco.bat

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@echo off
2+
3+
echo %*|>nul findstr /rx \-.*
4+
if ERRORLEVEL 1 (
5+
"%~dp0\jc.bat" "%cd%" %*
6+
) else (
7+
"%~dp0\autojump" %*
8+
)

windows/jo.bat

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@echo off
2+
setlocal EnableDelayedExpansion
3+
4+
echo %*|>nul findstr /rx \-.*
5+
if ERRORLEVEL 1 (
6+
for /f "delims=" %%i in ('"%~dp0\autojump" %*') do set new_path=%%i
7+
if exist !new_path!\nul (
8+
start "" "explorer" !new_path!
9+
) else (
10+
echo autojump: directory %* not found
11+
echo try `autojump --help` for more information
12+
)
13+
) else (
14+
"%~dp0\autojump" %*
15+
)

0 commit comments

Comments
 (0)