Skip to content

Commit f051da0

Browse files
committed
fix empty directory check for OS X and BSD
`ls` on those systems only recognizes short form flags fixes main problem of #17
1 parent 73f171f commit f051da0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

deploy.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ main() {
6060
echo "Deploy directory '$deploy_directory' does not exist. Aborting." >&2
6161
return 1
6262
fi
63-
64-
if [[ -z `ls --almost-all "$deploy_directory" 2> /dev/null` && -z $allow_empty ]]; then
63+
64+
# must use short form of flag in ls for compatibility with OS X and BSD
65+
if [[ -z `ls -A "$deploy_directory" 2> /dev/null` && -z $allow_empty ]]; then
6566
echo "Deploy directory '$deploy_directory' is empty. Aborting. If you're sure you want to deploy an empty tree, use the --allow-empty / -e flag." >&2
6667
return 1
6768
fi

0 commit comments

Comments
 (0)