Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add shellescape for some path arguments #14

Merged
merged 2 commits into from
Mar 31, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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