Sha256: 71403d3d963d4ad951d2c716f2c053a5c546541d3f75caf0e1735ec523575247

Contents?: true

Size: 1.07 KB

Versions: 9

Compression:

Stored size: 1.07 KB

Contents

#!/bin/sh
PATH_AND_FILE=$1

THE_PATH="${PATH_AND_FILE%/*}"
FILENAME="${PATH_AND_FILE##*/}"
echo "Script called"
echo "PATH_AND_FILE=$PATH_AND_FILE"
echo "THE_PATH=$THE_PATH"
echo "FILENAME=$FILENAME"

osascript <<EOF

tell application "iTerm"
  activate
  
  # Check to see if we have an open window. If not, open one.
  if (count windows) is 0 then # no window is open. 
    create window with default profile
    delay 0.5
  end if
  
  set currentWindow to current window # get a reference to current window
  
  # We have an open window. 
  tell current session of currentWindow
    if (is processing) or (name is not "bash") then # the current session is busy
      tell currentWindow
        create tab with default profile #- create a new tab
        delay 0.5
      end tell
    end if
  end tell
  
  tell current session of currentWindow
    # make sure we're in the right directory
    write text "cd '$THE_PATH'"
    delay 0.5
    
    # run the script
    set script_string to "$2" & " " & quoted form of "$FILENAME"
    write text script_string
    
  end tell
  
end tell
EOF

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
docker-cli-0.5.4 ruby-iterm2.sh
docker-cli-0.5.3 ruby-iterm2.sh
docker-cli-0.5.2 ruby-iterm2.sh
docker-cli-0.5.1 ruby-iterm2.sh
docker-cli-0.5.0 ruby-iterm2.sh
docker-cli-0.3.1 ruby-iterm2.sh
docker-cli-0.3.0 ruby-iterm2.sh
docker-cli-0.2.1 ruby-iterm2.sh
docker-cli-0.2.0 ruby-iterm2.sh