Use multiple argument form of system
This commit is contained in:
parent
8667387bee
commit
f0e13ee97b
@ -147,8 +147,8 @@ class Build
|
|||||||
|
|
||||||
f.brew do
|
f.brew do
|
||||||
if ARGV.flag? '--git'
|
if ARGV.flag? '--git'
|
||||||
system "git init"
|
system "git", "init"
|
||||||
system "git add -A"
|
system "git", "add", "-A"
|
||||||
end
|
end
|
||||||
if ARGV.interactive?
|
if ARGV.interactive?
|
||||||
ohai "Entering interactive mode"
|
ohai "Entering interactive mode"
|
||||||
|
|||||||
@ -21,7 +21,7 @@ module Homebrew
|
|||||||
# we downcase to avoid case-insensitive filesystem issues
|
# we downcase to avoid case-insensitive filesystem issues
|
||||||
tapd = HOMEBREW_LIBRARY/"Taps/#{user.downcase}/homebrew-#{repo.downcase}"
|
tapd = HOMEBREW_LIBRARY/"Taps/#{user.downcase}/homebrew-#{repo.downcase}"
|
||||||
return false if tapd.directory?
|
return false if tapd.directory?
|
||||||
abort unless system "git clone https://github.com/#{repouser}/homebrew-#{repo} #{tapd}"
|
abort unless system "git", "clone", "https://github.com/#{repouser}/homebrew-#{repo}", tapd.to_s
|
||||||
|
|
||||||
files = []
|
files = []
|
||||||
tapd.find_formula { |file| files << file }
|
tapd.find_formula { |file| files << file }
|
||||||
|
|||||||
@ -77,17 +77,17 @@ module Homebrew
|
|||||||
private
|
private
|
||||||
|
|
||||||
def git_init_if_necessary
|
def git_init_if_necessary
|
||||||
if Dir['.git/*'].empty?
|
if Dir[".git/*"].empty?
|
||||||
safe_system "git init"
|
safe_system "git", "init"
|
||||||
safe_system "git config core.autocrlf false"
|
safe_system "git", "config", "core.autocrlf", "false"
|
||||||
safe_system "git remote add origin https://github.com/Homebrew/homebrew.git"
|
safe_system "git", "remote", "add", "origin", "https://github.com/Homebrew/homebrew.git"
|
||||||
safe_system "git fetch origin"
|
safe_system "git", "fetch", "origin"
|
||||||
safe_system "git reset --hard origin/master"
|
safe_system "git", "reset", "--hard", "origin/master"
|
||||||
end
|
end
|
||||||
|
|
||||||
if `git remote show origin -n` =~ /Fetch URL: \S+mxcl\/homebrew/
|
if `git remote show origin -n` =~ /Fetch URL: \S+mxcl\/homebrew/
|
||||||
safe_system "git remote set-url origin https://github.com/Homebrew/homebrew.git"
|
safe_system "git", "remote", "set-url", "origin", "https://github.com/Homebrew/homebrew.git"
|
||||||
safe_system "git remote set-url --delete origin .*mxcl\/homebrew.*"
|
safe_system "git", "remote", "set-url", "--delete", "origin", ".*mxcl\/homebrew.*"
|
||||||
end
|
end
|
||||||
rescue Exception
|
rescue Exception
|
||||||
FileUtils.rm_rf ".git"
|
FileUtils.rm_rf ".git"
|
||||||
@ -138,12 +138,12 @@ class Updater
|
|||||||
attr_reader :initial_revision, :current_revision
|
attr_reader :initial_revision, :current_revision
|
||||||
|
|
||||||
def pull!
|
def pull!
|
||||||
safe_system "git checkout -q master"
|
safe_system "git", "checkout", "-q", "master"
|
||||||
|
|
||||||
@initial_revision = read_current_revision
|
@initial_revision = read_current_revision
|
||||||
|
|
||||||
# ensure we don't munge line endings on checkout
|
# ensure we don't munge line endings on checkout
|
||||||
safe_system "git config core.autocrlf false"
|
safe_system "git", "config", "core.autocrlf", "false"
|
||||||
|
|
||||||
args = ["pull"]
|
args = ["pull"]
|
||||||
args << "--rebase" if ARGV.include? "--rebase"
|
args << "--rebase" if ARGV.include? "--rebase"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user