Sha256: 7cd8454eeae71ff4fdcac97920d45cc2e625b6d15e7d6e2410d26a95669f3511

Contents?: true

Size: 1.37 KB

Versions: 18

Compression:

Stored size: 1.37 KB

Contents

# Copyright (C) 2020  Chris Liaw <chrisliaw@antrapol.com>
# Author: Chris Liaw <chrisliaw@antrapol.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.



module GitCli
  module Pull

    def pull(repos, branch = "master")
      check_vcs
      #check_repos
      raise_if_empty(repos, "Pull from repository name cannot be empty", GitCliException)

      raise_if_false(is_repos_exist?(repos), "Given repository name '#{repos}' is not configured for this workspace", GitCliException)
      
      cmd = []
      cmd << "cd"
      cmd << @wsPath
      cmd << "&&"
      cmd << @vcs.exe_path
      cmd << "pull"
      cmd << repos
      cmd << branch

      cmdln = cmd.join " "

      log_debug "Pull : #{cmdln}"
      os_exec(cmdln) do |st, res|
        [st.success?, res.strip]
      end
      
    end

  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
git_cli-0.13.9 lib/git_cli/pull.rb
git_cli-0.13.8 lib/git_cli/pull.rb
git_cli-0.13.7 lib/git_cli/pull.rb
git_cli-0.13.6 lib/git_cli/pull.rb
git_cli-0.12.0 lib/git_cli/pull.rb
git_cli-0.11.4 lib/git_cli/pull.rb
git_cli-0.11.3 lib/git_cli/pull.rb
git_cli-0.11.2 lib/git_cli/pull.rb
git_cli-0.11.0 lib/git_cli/pull.rb
git_cli-0.9.0 lib/git_cli/pull.rb
git_cli-0.8.0 lib/git_cli/pull.rb
git_cli-0.7.0 lib/git_cli/pull.rb
git_cli-0.6.0 lib/git_cli/pull.rb
git_cli-0.5.0 lib/git_cli/pull.rb
git_cli-0.4.0 lib/git_cli/pull.rb
git_cli-0.3.0 lib/git_cli/pull.rb
git_cli-0.2.0 lib/git_cli/pull.rb
git_cli-0.1.0 lib/git_cli/pull.rb