Commit 453a7dae authored by Fabio Pelosin's avatar Fabio Pelosin

Merge branch 'master' of https://github.com/apalancat/CocoaPods into apalancat-master

* 'master' of https://github.com/apalancat/CocoaPods:
  Test and documentation for issue #1694
  Unset the `CDPATH` env variable before shelling-out. #1694

Conflicts:
	CHANGELOG.md
parents 027b9f27 9a4e304c
...@@ -23,6 +23,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides ...@@ -23,6 +23,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[#1933](https://github.com/CocoaPods/CocoaPods/issues/1933) [#1933](https://github.com/CocoaPods/CocoaPods/issues/1933)
[#1941](https://github.com/CocoaPods/CocoaPods/pull/1941) [#1941](https://github.com/CocoaPods/CocoaPods/pull/1941)
* Unset the `CDPATH` env variable before shelling-out on `prepare_command`
[Marc Boquet](https://github.com/apalancat)
[#1943](https://github.com/CocoaPods/CocoaPods/pull/1943)
##### Bug Fixes ##### Bug Fixes
* Fix :head option for Pods from HTTP source. * Fix :head option for Pods from HTTP source.
......
...@@ -130,12 +130,17 @@ module Pod ...@@ -130,12 +130,17 @@ module Pod
# Runs the prepare command bash script of the spec. # Runs the prepare command bash script of the spec.
# #
# @note Unsets the `CDPATH` env variable before running the
# shell script to avoid issues with relative paths
# (issue #1694).
#
# @return [void] # @return [void]
# #
def run_prepare_command def run_prepare_command
return unless root_spec.prepare_command return unless root_spec.prepare_command
UI.section(" > Running prepare command", '', 1) do UI.section(" > Running prepare command", '', 1) do
Dir.chdir(root) do Dir.chdir(root) do
ENV.delete('CDPATH')
prepare_command = root_spec.prepare_command.strip_heredoc.chomp prepare_command = root_spec.prepare_command.strip_heredoc.chomp
full_command = "\nset -e\n" + prepare_command full_command = "\nset -e\n" + prepare_command
bash!(full_command) bash!(full_command)
......
...@@ -113,6 +113,13 @@ module Pod ...@@ -113,6 +113,13 @@ module Pod
@installer.install! @installer.install!
end.message.should.match /command not found/ end.message.should.match /command not found/
end end
it "unsets $CDPATH environment variable" do
ENV['CDPATH'] = "BogusPath"
@spec.prepare_command = "cd Classes;ls Banana.h"
lambda { @installer.install! }.should.not.raise
end
end end
#--------------------------------------# #--------------------------------------#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment