diff options
Diffstat (limited to 'sync.sh')
-rwxr-xr-x | sync.sh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/sync.sh b/sync.sh new file mode 100755 index 0000000000..ab0fb578c5 --- /dev/null +++ b/sync.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +usage() +{ + echo "Usage: sync [-p]" + echo "Repository syncing script." + echo " -p Restore all NuGet packages for the repository" + echo "If no option is specified, then \"sync.sh -p\" is implied." + exit 1 +} + +working_tree_root="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +unprocessedBuildArgs= + +# Parse arguments +if [ $# == 0 ]; then + buildArgs="-p" +fi + +while [[ $# -gt 0 ]] +do + opt="$1" + case $opt in + -h|--help) + usage + ;; + -p) + buildArgs="-p" + ;; + *) + unprocessedBuildArgs="$unprocessedBuildArgs $1" + esac + shift +done + +$working_tree_root/run.sh sync $buildArgs $unprocessedBuildArgs +if [ $? -ne 0 ] +then + echo "ERROR: An error occurred while syncing packages; See $working_tree_root/sync.log for more details. There may have been networking problems, so please try again in a few minutes." + exit 1 +fi + +echo "Sync completed successfully." +exit 0 |