Skip to content

Commit

Permalink
Current directory as default if argument is not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
macecchi committed May 5, 2016
1 parent 39a31ec commit b95f7ef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions xcopen
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/bash
EXT='xcworkspace'
dir=$1

DIR=${1:-.} # DIR is either the first argument or the current directory

shopt -s nullglob

found=0
for i in $1/*.${EXT}; do
for i in ${DIR}/*.${EXT}; do
open -a Xcode "$i"
found=1
break
Expand Down

0 comments on commit b95f7ef

Please sign in to comment.