diff --git a/git-now-push b/git-now-push index bbb4e88..0220cb5 100644 --- a/git-now-push +++ b/git-now-push @@ -9,8 +9,10 @@ cmd_default() { WORKING_BRANCH=$(git_current_branch) if [ -n "$REMOTE" ]; then + git pull -q ${REMOTE} ${WORKING_BRANCH} git push ${REMOTE} :${WORKING_BRANCH} && git push ${REMOTE} ${WORKING_BRANCH} else + git pull -q origin ${WORKING_BRANCH} git push origin :${WORKING_BRANCH} && git push fi } diff --git a/git-now.rb b/git-now.rb index 8d18ebb..01f29f3 100644 --- a/git-now.rb +++ b/git-now.rb @@ -1,8 +1,8 @@ require 'formula' class GitNow < Formula - url 'https://github.com/iwata/git-now.git', :tag => 'v0.1.0.5' - version '0.1.0.5' + url 'https://github.com/iwata/git-now.git', :tag => 'v0.1.0.6' + version '0.1.0.6' head 'https://github.com/iwata/git-now.git', :branch => 'develop' homepage 'https://github.com/iwata/git-now' @@ -23,9 +23,10 @@ class GitNow < Formula if ARGV.include? '--gnu-getopt' system "brew ln gnu-getopt" end - if ARGV.include? '--zsh-completion' - fpath = `echo #{ENV['FPATH']} |cut -d ':' -f 1` - system "cp etc/_git-now #{fpath}" unless fpath.chomp === '' + if ARGV.include?('--zsh-completion') && ENV.include?('FPATH') + ENV['FPATH'].split(':').find do |path| + system "cp etc/_git-now #{path}" if File.directory? path + end end end