Navigation Menu

Skip to content

Commit

Permalink
Make the script compatible with sed on BSD
Browse files Browse the repository at this point in the history
  • Loading branch information
darashi committed Aug 28, 2012
1 parent 9d5a0c5 commit 7383bd2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions bin/gcs-import-examples
Expand Up @@ -58,8 +58,17 @@ echo $create_domain_result
echo
echo

documents_endpoint=`echo "$create_domain_result" | sed -r -e "s/.+<DocService><Endpoint>//" | sed -r -e "s/<.+//"`
search_endpoint=`echo "$create_domain_result" | sed -r -e "s/.+<SearchService><Endpoint>//" | sed -r -e "s/<.+//"`
case $(uname) in
Darwin|*BSD)
sed="sed -E"
;;
*)
sed="sed -r"
;;
esac

documents_endpoint=`echo "$create_domain_result" | $sed -e "s/.+<DocService><Endpoint>//" | $sed -e "s/<.+//"`
search_endpoint=`echo "$create_domain_result" | $sed -e "s/.+<SearchService><Endpoint>//" | $sed -e "s/<.+//"`

echo "==== Adding index fields"
echo "== Creating 'name' field"
Expand Down

0 comments on commit 7383bd2

Please sign in to comment.