2
0
MasterPassword/Scripts/updateDependencies

43 lines
1.2 KiB
Plaintext
Raw Normal View History

2011-11-30 21:42:40 +00:00
#!/usr/bin/env bash
# This script should be in the 'Scripts' directory under the git repository's root.
cd "${BASH_SOURCE%/*}/.."
shopt -s extglob
2012-01-12 16:28:20 +00:00
## LisuUI
2011-11-30 21:42:40 +00:00
#
## Submodules that need to be checked out.
dependencies=( External/InAppSettingsKit External/Pearl External/Pearl:External/jrswizzle External/Pearl:External/uicolor-utilities External/Pearl:External/iOSPorts )
2011-11-30 21:42:40 +00:00
## Custom migration.
2012-01-12 16:28:20 +00:00
# None yet.
2011-11-30 21:42:40 +00:00
################################################################################
isCheckedOut() {
local modulePath=$1
! git submodule status | grep -q "^-[^ ]* $modulePath"
}
# Check out our missing dependencies
for dependency in "${dependencies[@]}"; do
[[ $dependency = *:* ]] && root=${dependency%%:*} || root=.
path=${dependency#*:}
( cd "$root"; git submodule update --init "$path" )
done
# Update our modules
# git submodule sync -- A bug causes this to init ALL external dependencies.
git submodule sync $(git submodule status | awk '/^ / { print $2 }')
git submodule update
# Our modules may define a custom update script, if so, run it.
find !(Scripts)/ -name "${BASH_SOURCE##*/}" -exec {} \;
# Finally, for our modules that haven't got a custom update script, update them recursively.
git submodule update --recursive --rebase