From 3d4177a85f3a1be364f81d6d645c63f09e93bdb0 Mon Sep 17 00:00:00 2001 From: Alexey Gerasimov Date: Mon, 13 Nov 2017 10:43:45 +0300 Subject: [PATCH 1/2] Remove pods repo if lock file exists --- xcode/commonFastfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xcode/commonFastfile b/xcode/commonFastfile index 8219704..43d4de6 100644 --- a/xcode/commonFastfile +++ b/xcode/commonFastfile @@ -1,6 +1,14 @@ $appName = File.basename(Dir['../*.xcworkspace'].first, '.*') before_all do |lane, options| + podsReposPath = "/Users/builder/.cocoapods/repos/master/" + lockFilePath = "#{podsReposPath}.git/index.lock" + + # check if .lock file exists in pod repos - then remove all master repo + if File.exists? lockFilePath + sh("rm -rf #{podsReposPath}") + end + cocoapods( clean: true, repo_update: true From a75f05591523c346915445b443b324c8cca38f42 Mon Sep 17 00:00:00 2001 From: Alexey Gerasimov Date: Mon, 13 Nov 2017 11:05:20 +0300 Subject: [PATCH 2/2] Path made user-independent --- xcode/commonFastfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xcode/commonFastfile b/xcode/commonFastfile index 43d4de6..be94ff6 100644 --- a/xcode/commonFastfile +++ b/xcode/commonFastfile @@ -1,8 +1,8 @@ $appName = File.basename(Dir['../*.xcworkspace'].first, '.*') before_all do |lane, options| - podsReposPath = "/Users/builder/.cocoapods/repos/master/" - lockFilePath = "#{podsReposPath}.git/index.lock" + podsReposPath = File.expand_path "~/.cocoapods/repos/master/" + lockFilePath = "#{podsReposPath}/.git/index.lock" # check if .lock file exists in pod repos - then remove all master repo if File.exists? lockFilePath