diff --git a/build.sh b/build.sh index 01e0fc4..84698a6 100755 --- a/build.sh +++ b/build.sh @@ -13,7 +13,7 @@ function puts-step (){ # Argument parsing. -while getopts ":f:x:p:" opt; do +while getopts ":f:x:p:r:" opt; do case $opt in f) FORMULA=$OPTARG @@ -28,6 +28,10 @@ while getopts ":f:x:p:" opt; do ARCHIVE=$OPTARG echo "Using archive: $OPTARG" >&2 ;; + r) + S3_BUCKET=$OPTARG + echo "Using s3 bucket: $OPTARG" >&2 + ;; \?) echo "Invalid option: -$OPTARG" >&2 exit 1 @@ -62,4 +66,9 @@ $(pwd)/formula/$FORMULA $PREFIX_PATH | indent if [ "$ARCHIVE" ]; then tar cjf $ARCHIVE $PREFIX_PATH -fi \ No newline at end of file +fi + +if [ "$S3_BUCKET" ]; then + s3put -b $S3_BUCKET $ARCHIVE +fi +