Skip to content

Commit

Permalink
Merge pull request #14 from chipp/master
Browse files Browse the repository at this point in the history
add shellescape for some path arguments
  • Loading branch information
fabiopelosin committed Mar 31, 2014
2 parents d064235 + 8a217d9 commit 7e65134
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## Master

###### Enhancements

* add shellescape for some path arguments in git.rb
[Vladimir Burdukov](https://github.com/chipp)
[#14](https://github.com/CocoaPods/cocoapods-downloader/pull/14)

## 0.4.0

###### Enhancements
Expand Down
4 changes: 2 additions & 2 deletions lib/cocoapods-downloader/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def clone_url
#
def clone(from, to, flags = '')
ui_sub_action("Cloning to Pods folder") do
command = %Q|clone #{from} #{to.shellescape}|
command = %Q|clone #{from.shellescape} #{to.shellescape}|
command << ' ' + flags if flags
git!(command)
end
Expand Down Expand Up @@ -275,7 +275,7 @@ def download_and_extract_tarball(id)
tmpfile.write Zlib::GzipReader.new(archive).read
end

system "tar xf #{tmpfile.path} -C #{target_path} --strip-components 1"
system "tar xf #{tmpfile.path.shellescape} -C #{target_path.shellescape} --strip-components 1"
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/git_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def downloader.execute_command(executable, command, raise_on_failure = false)
it "updates the cache if the ref is not available" do
# create the origin repo and the cache
tmp_repo_path = tmp_folder + 'git-repo-source'
`git clone #{fixture('git-repo')} #{tmp_repo_path}`
`git clone #{fixture('git-repo').shellescape} #{tmp_repo_path.shellescape}`
options = { :git => tmp_repo_path, :commit => '7ad3a6c' }
downloader = Downloader.for_target(tmp_folder('checkout'), options)
downloader.download
Expand Down

0 comments on commit 7e65134

Please sign in to comment.