Skip to content

Commit

Permalink
Merge pull request #26 from kotfic/master
Browse files Browse the repository at this point in the history
Fix equality test in vagrant-tramp-ssh, treat string after the last underscore as the machine name.
  • Loading branch information
ryanprior committed Jan 21, 2016
2 parents 2041367 + c3cc7f1 commit 660b84f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bin/vagrant-tramp-ssh
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@
## for more details.


read dir_name name <<<\
read name dir_name <<<\
$(echo $1 \
| awk -F_ '{ print $1; print $2 }')
| awk -F_ '{print $NF; NF--; gsub(/ /, "_", $0); print $0}')
if [[ ! $name ]]; then name="default"; fi
read id dir <<<\
$(vagrant global-status \
| awk -v name=$name \
-v dir=$dir_name \
"\$2=name && \$5~dir { print \$1; print \$5 }")
"\$2==name && \$5~dir { print \$1; print \$5 }")
cd "$dir"
vagrant ssh $id

0 comments on commit 660b84f

Please sign in to comment.