Skip to content

Instantly share code, notes, and snippets.

@philiprhoades
Created July 31, 2015 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save philiprhoades/460b751e7c6b74def3a8 to your computer and use it in GitHub Desktop.
Save philiprhoades/460b751e7c6b74def3a8 to your computer and use it in GitHub Desktop.
Script for pulling, building and testing MaidSafe code
#!/bin/bash
#### if you use a proxy add it here
# http_proxy=http://127.0.0.1:8118/
# HTTP_PROXY=$http_proxy
# export http_proxy HTTP_PROXY
# git config --global http.proxy $HTTP_PROXY
##### end proxy stuff ##########
#### add your parent folder here ####
parentFolder='/home/phil/src/rust/maidsafe/'
if [ ! -d ${parentFolder} ]; then
mkdir ${parentFolder}
fi
dirs="crust routing maidsafe_client maidsafe_types maidsafe_vault maidsafe_nfs"
cd ${parentFolder}
pull() {
subFolder=${parentFolder}${1}
if [ ! -d ${subFolder} ]; then
git clone https://github.com/maidsafe/${1}
else
cd ${subFolder}
git pull origin master
fi
}
build() {
subFolder=${parentFolder}${1}
cd ${subFolder}
cargo build &
}
tst() {
subFolder=${parentFolder}${1}
xterm -hold -e "cd ${subFolder} && cargo test" &
}
for action in pull build tst
do
for dir in $dirs
do
echo ""
echo $dir
echo ""
# echo "Hit ENTER to continue:"
# read junk
$action $dir
done
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment