5 echo "Usage: sync [-p] [-s]"
6 echo "Repository syncing script."
7 echo " -s Fetch source history from all configured remotes"
8 echo " (git fetch --all -p -v)"
9 echo " -p Restore all NuGet packages for the repository"
11 echo "If no option is specified, then \"sync.sh -p -s\" is implied."
15 working_tree_root="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
16 sync_log=$working_tree_root/sync.log
18 options="/nologo /v:minimal /clp:Summary /flp:v=detailed;Append;LogFile=$sync_log"
21 echo "Running sync.sh $*" > $sync_log
43 unprocessedBuildArgs="$unprocessedBuildArgs $1"
48 echo "Running init-tools.sh"
49 $working_tree_root/init-tools.sh
51 if [ "$sync_src" == true ]; then
52 echo "Fetching git database from remote repos..."
53 git fetch --all -p -v >> $sync_log 2>&1
55 echo -e "\ngit fetch failed. Aborting sync." >> $sync_log
56 echo "ERROR: An error occurred while fetching remote source code; see $sync_log for more details."
61 if [ "$sync_packages" == true ]; then
62 options="$options /t:RestoreNETCorePlatforms /p:RestoreDuringBuild=true"
63 echo "Restoring all packages..."
64 echo -e "\n$working_tree_root/Tools/corerun $working_tree_root/Tools/MSBuild.exe $working_tree_root/build.proj $options $unprocessedBuildArgs" >> $sync_log
65 $working_tree_root/Tools/corerun $working_tree_root/Tools/MSBuild.exe $working_tree_root/build.proj $options $unprocessedBuildArgs
68 echo -e "\nPackage restored failed. Aborting sync." >> $sync_log
69 echo "ERROR: An error occurred while syncing packages; see $sync_log for more details. There may have been networking problems, so please try again in a few minutes."
74 echo "Sync completed successfully."
75 echo -e "\nSync completed successfully." >> $sync_log