Skip to content

Instantly share code, notes, and snippets.

@Kalvin126
Last active March 29, 2018 04:29
Show Gist options
  • Save Kalvin126/d95b196a770e7cc0fdd2d537abd5729b to your computer and use it in GitHub Desktop.
Save Kalvin126/d95b196a770e7cc0fdd2d537abd5729b to your computer and use it in GitHub Desktop.
module Fastlane
module Actions
class WaitForPodInstanceAvailabilityAction < Action
def self.run(params)
wait_for_pod_done!
end
def self.pod_process_exists!
output = Fastlane::Actions::sh('ps -aef | awk \'/[p]od /{print $2}\'', log: false)
return output.length > 0
end
def self.wait_for_pod_done!
if pod_process_exists!
sleep_duration = 15
UI.message "CocoaPods process exists. Sleeping for #{sleep_duration}"
Fastlane::Actions::sh("sleep #{sleep_duration}", log: false)
wait_for_pod_done!
else
UI.message "CocoaPods is availible"
end
end
def self.description
"Waits for any CocoaPods operations to finish and then returns"
end
def self.is_supported?(platform)
[:ios].include?(platform)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment