Guest User

Untitled

a guest
Mar 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # In iTerm's Preferences > Profiles > Default > Advanced > Semantic History,
  4. # choose 'Run command...' and enter '/your/path/to/iterm_open_project "\1" "\2" "\3" "\4" "\5"'.
  5.  
  6. FILENAME=${1}
  7. LINE_NUMBER=${2:-0}
  8. TEXT_BEFORE_CLICK=${3}
  9. TEXT_AFTER_CLICK=${4}
  10. PWD=${5}
  11.  
  12. if [[ "$PWD" -ef ~/Projects/WEB-STROM-PROJECT ]]; then
  13. /usr/local/bin/webstorm "$PWD" --line "$LINE_NUMBER" "$FILENAME"
  14. exit 0
  15. fi
  16.  
  17. file "$FILENAME" | grep -q "text"
  18. if [ $? -eq 0 ]; then
  19. /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl "$FILENAME":"$LINE_NUMBER"
  20. exit 0
  21. fi
  22.  
  23. /usr/bin/open "$FILENAME"
Add Comment
Please, Sign In to add comment