Skip to content

Instantly share code, notes, and snippets.

@dislogical
Last active October 23, 2019 22:29
Show Gist options
  • Select an option

  • Save dislogical/35b0898b24889862fa733d6e6e05eb30 to your computer and use it in GitHub Desktop.

Select an option

Save dislogical/35b0898b24889862fa733d6e6e05eb30 to your computer and use it in GitHub Desktop.
AWS C Library Updater
#!/bin/bash
set -e
repos=(
s2n
common
checksums
event-stream
cal
io
compression
auth
http
mqtt
)
build_log=`pwd`/build_log.txt
for path in ${repos[@]}; do
pushd "$path" > /dev/null
branch=`git rev-parse --abbrev-ref HEAD`
echo "Pulling ${path} (${branch})"
if ! git pull > /dev/null 2>&1; then
echo "!!! Pulling branch ${branch} failed, switching to master"
git checkout master > /dev/null 2>&1
git pull > /dev/null 2>&1
fi
echo "Building ${path}"
ninja -C build install > ${build_log} 2>&1 || (cat ${build_log} && exit 1)
popd > /dev/null
done
rm -f ${build_log}
echo "Update complete"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment