Disable outdated test until it is updated
[platform/upstream/coreclr.git] / sync.sh
1 #!/usr/bin/env bash
2
3 usage()
4 {
5     echo "Usage: sync [-p]"
6     echo "Repository syncing script."
7     echo "  -p         Restore all NuGet packages for the repository"
8     echo "If no option is specified, then \"sync.sh -p\" is implied."
9     exit 1
10 }
11
12 working_tree_root="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
13 unprocessedBuildArgs=
14
15 # Parse arguments
16 # Assume the default '-p' argument if the only arguments specified are specified after double dash.
17 # Only position parameters can be specified after the double dash.
18 if [ $# == 0 ] || [ $1 == '--' ]; then
19     buildArgs="-p"
20 fi
21
22 while [[ $# -gt 0 ]]
23 do
24     opt="$1"
25     case $opt in
26         -h|--help)
27         usage
28         ;;
29         -p)
30         buildArgs="-p"
31         ;;
32         *)
33         unprocessedBuildArgs="$unprocessedBuildArgs $1"
34     esac
35     shift
36 done
37
38 $working_tree_root/run.sh sync $buildArgs $unprocessedBuildArgs
39 if [ $? -ne 0 ]
40 then
41     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."
42     exit 1
43 fi
44
45 echo "Sync completed successfully."
46 exit 0