Tweaked when the page refreshes a bit
Only refresh if we're in my ~/Sites directory (since I most likely will have a site up in the browser). Also checks to see if the domain of the site starts with "local" which would imply that the tab I have active is what I'm working on.
This commit is contained in:
parent
6c4ed6c65c
commit
36c2329fc8
1 changed files with 8 additions and 6 deletions
14
bash/refresh
14
bash/refresh
|
@ -1,8 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
osascript -e 'tell application "Safari"' \
|
||||
-e 'activate' \
|
||||
-e 'do javascript "window.location.reload();" in first document' \
|
||||
-e 'end tell' > /dev/null;
|
||||
|
||||
osascript -e 'tell application "iTerm" to activate'
|
||||
if [[ $(pwd) == /Users/josh/Sites/* ]];
|
||||
then
|
||||
osascript -e 'tell application "Safari"' \
|
||||
-e 'activate' \
|
||||
-e 'do javascript "if (location.href.substring(7, 12) == \"local\") { window.location.reload(); }" in first document' \
|
||||
-e 'end tell' > /dev/null;
|
||||
osascript -e 'tell application "iTerm" to activate'
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue