You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 line
565 B

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