Attempt to fix the cocoapods_cache lock logic to handle failures

pull/813/head
Morgan Pretty 2 years ago
parent b471a32209
commit c29827356c

@ -20,17 +20,24 @@ local install_cocoapods = {
local load_cocoapods_cache = { local load_cocoapods_cache = {
name: 'Load CocoaPods Cache', name: 'Load CocoaPods Cache',
commands: [ commands: [
|||
if [[ ! -f /Users/drone/.cocoapods_cache.valid ]]; then
rm /Users/drone/.cocoapods_cache.lock
fi
|||,
||| |||
while test -e /Users/drone/.cocoapods_cache.lock; do while test -e /Users/drone/.cocoapods_cache.lock; do
sleep 1 sleep 1
done done
|||, |||,
'touch /Users/drone/.cocoapods_cache.lock', 'touch /Users/drone/.cocoapods_cache.lock',
'rm /Users/drone/.cocoapods_cache.valid',
||| |||
if [[ -d /Users/drone/.cocoapods_cache ]]; then if [[ -d /Users/drone/.cocoapods_cache ]]; then
cp -r /Users/drone/.cocoapods_cache ./Pods cp -r /Users/drone/.cocoapods_cache ./Pods
fi fi
|||, |||,
'touch /Users/drone/.cocoapods_cache.valid',
'rm /Users/drone/.cocoapods_cache.lock' 'rm /Users/drone/.cocoapods_cache.lock'
] ]
}; };
@ -45,12 +52,14 @@ local update_cocoapods_cache = {
done done
|||, |||,
'touch /Users/drone/.cocoapods_cache.lock', 'touch /Users/drone/.cocoapods_cache.lock',
'rm /Users/drone/.cocoapods_cache.valid',
||| |||
if [[ -d ./Pods ]]; then if [[ -d ./Pods ]]; then
rm -rf /Users/drone/.cocoapods_cache rm -rf /Users/drone/.cocoapods_cache
cp -r ./Pods /Users/drone/.cocoapods_cache cp -r ./Pods /Users/drone/.cocoapods_cache
fi fi
|||, |||,
'touch /Users/drone/.cocoapods_cache.valid',
'rm /Users/drone/.cocoapods_cache.lock' 'rm /Users/drone/.cocoapods_cache.lock'
] ]
}; };

Loading…
Cancel
Save