Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "Don't try to create dirs if they already exists"

This reverts commit 8286722.
  • Loading branch information...
commit 0891a387ddc481bc633b6a5245e01fbc8f6da44f 1 parent 5895208
Santiago Pastorino spastorino authored
4 lib/bundler.rb
View
@@ -82,7 +82,7 @@ def bin_path
@bin_path ||= begin
path = settings[:bin] || "bin"
path = Pathname.new(path).expand_path(root)
- FileUtils.mkdir_p(path) unless File.exist?(path)
+ FileUtils.mkdir_p(path)
Pathname.new(path).expand_path
end
end
@@ -202,7 +202,7 @@ def mkdir_p(path)
sudo "mkdir -p '#{path}'"
else
FileUtils.mkdir_p(path)
- end unless File.exist?(path)
+ end
end
def sudo(str)
4 lib/bundler/runtime.rb
View
@@ -81,7 +81,7 @@ def dependencies_for(*groups)
alias gems specs
def cache
- FileUtils.mkdir_p(cache_path) unless File.exist?(cache_path)
+ FileUtils.mkdir_p(cache_path)
Bundler.ui.info "Updating .gem files in vendor/cache"
specs.each do |spec|
@@ -92,7 +92,7 @@ def cache
end
def prune_cache
- FileUtils.mkdir_p(cache_path) unless File.exist?(cache_path)
+ FileUtils.mkdir_p(cache_path)
resolve = @definition.resolve
cached = Dir["#{cache_path}/*.gem"]
2  lib/bundler/settings.rb
View
@@ -99,7 +99,7 @@ def set_key(key, value, hash, file)
unless hash[key] == value
hash[key] = value
hash.delete(key) if value.nil?
- FileUtils.mkdir_p(file.dirname) unless File.exist?(file.dirname)
+ FileUtils.mkdir_p(file.dirname)
File.open(file, "w") { |f| f.puts hash.to_yaml }
end
value
14 lib/bundler/source.rb
View
@@ -242,7 +242,7 @@ def download_gem_from_uri(spec, uri)
download_path = Bundler.requires_sudo? ? Bundler.tmp : Gem.dir
gem_path = "#{Gem.dir}/cache/#{spec.full_name}.gem"
- FileUtils.mkdir_p("#{download_path}/cache") unless File.exist?("#{download_path}/cache")
+ FileUtils.mkdir_p("#{download_path}/cache")
Gem::RemoteFetcher.fetcher.download(spec, uri, download_path)
if Bundler.requires_sudo?
@@ -391,14 +391,10 @@ def initialize(spec, options = {})
def generate_bin
return if spec.executables.nil? || spec.executables.empty?
- if Bundler.requires_sudo?
- FileUtils.mkdir_p("#{Bundler.tmp}/bin") unless File.exist?("#{Bundler.tmp}/bin")
- end
-
+ FileUtils.mkdir_p("#{Bundler.tmp}/bin") if Bundler.requires_sudo?
super
-
if Bundler.requires_sudo?
- Bundler.mkdir_p("#{Gem.dir}/bin") unless File.exist?("#{Gem.dir}/bin")
+ Bundler.mkdir_p "#{Gem.dir}/bin"
spec.executables.each do |exe|
Bundler.sudo "cp -R #{Bundler.tmp}/bin/#{exe} #{Gem.dir}/bin/"
end
@@ -618,14 +614,14 @@ def cache
in_cache { git %|fetch --force --quiet "#{uri}" refs/heads/*:refs/heads/*| }
else
Bundler.ui.info "Fetching #{uri}"
- FileUtils.mkdir_p(cache_path.dirname) unless File.exist?(cache_path.dirname)
+ FileUtils.mkdir_p(cache_path.dirname)
git %|clone "#{uri}" "#{cache_path}" --bare --no-hardlinks|
end
end
def checkout
unless File.exist?(path.join(".git"))
- FileUtils.mkdir_p(path.dirname) unless File.exist?(path.dirname)
+ FileUtils.mkdir_p(path.dirname)
git %|clone --no-checkout "#{cache_path}" "#{path}"|
end
Dir.chdir(path) do
Please sign in to comment.
Something went wrong with that request. Please try again.