start adding git push functionality

This commit is contained in:
Jason Buckner
2012-11-24 21:01:37 -08:00
committed by thilko
parent 2667053fde
commit 9ac754fd40
2 changed files with 25 additions and 0 deletions

View File

@@ -79,6 +79,13 @@ class Homesick < Thor
end end
desc "push NAME", "Push the specified castle"
method_option :all, :type => :boolean, :default => false, :required => false, :desc => "Update all cloned castles"
def push(name)
push_castle name
end
desc "symlink NAME", "Symlinks all dotfiles from the specified castle" desc "symlink NAME", "Symlinks all dotfiles from the specified castle"
method_option :force, :default => false, :desc => "Overwrite existing conflicting symlinks without prompting." method_option :force, :default => false, :desc => "Overwrite existing conflicting symlinks without prompting."
def symlink(name) def symlink(name)
@@ -207,4 +214,12 @@ class Homesick < Thor
git_submodule_update git_submodule_update
end end
end end
def push_castle(castle)
check_castle_existance(castle, "push")
inside repos_dir.join(castle) do
git_commit_all
git_push
end
end
end end

View File

@@ -60,6 +60,16 @@ class Homesick
system "git pull --quiet" unless options[:pretend] system "git pull --quiet" unless options[:pretend]
end end
def git_push(config = {})
say_status 'git push', '', :green unless options[:quiet]
system "git push" unless options[:pretend]
end
def git_commit_all(config = {})
say_status 'git commit all', '', :green unless options[:quiet]
system "git commit -v -a" unless options[:pretend]
end
def mv(source, destination, config = {}) def mv(source, destination, config = {})
source = Pathname.new(source) source = Pathname.new(source)
destination = Pathname.new(destination + source.basename) destination = Pathname.new(destination + source.basename)