Sha256: fba91bfcb3d26031d0cad800a3cac9f3b3a4d412c8771158f1a89cd6925e8f27

Contents?: true

Size: 1.14 KB

Versions: 3

Compression:

Stored size: 1.14 KB

Contents

require 'cocoapods-bb-PodAssistant/helpers/git_cmd_helper'
require 'cocoapods-bb-PodAssistant/config/stable_source'

module BB
    class StableEnv
        def initialize(stable_source = nil, stable_branch = nil, stable_tag = nil)
            if stable_source.nil?
              stable_source = StableSource.stable_default_source
            end
            @stable_source = stable_source
            @stable_branch = stable_branch
            @stable_tag = stable_tag

            @cache = BB::Cache.new()
            configGitPath(@cache.cachePath)
        end

        # stable 环境,执行pod stable
        def loadStaleEnv
            
        end

        # 开发环境,执行pod install/update
        def loadDeveloperEnv
            cachePath = @cache.cachePath
            puts "hook [pod install/update] sync stable git=>#{cachePath}"
            if Dir.exist?(File.join(cachePath))
              `cd #{cachePath}; git switch main; git pull --all`
            else
              clonePath = File.dirname(cachePath)
              FileUtils.mkdir_p clonePath
              `git clone #{@stable_source} #{cachePath}`
            end
        end
    end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cocoapods-bb-PodAssistant-0.1.6 lib/cocoapods-bb-PodAssistant/helpers/stable_env_helper.rb
cocoapods-bb-PodAssistant-0.1.5.1 lib/cocoapods-bb-PodAssistant/helpers/stable_env_helper.rb
cocoapods-bb-PodAssistant-0.1.5 lib/cocoapods-bb-PodAssistant/helpers/stable_env_helper.rb