Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
e7ec75ee
Commit
e7ec75ee
authored
Feb 23, 2016
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PodSourcePreparer] Don't leak version var on failure
parent
eb142cb2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
pod_source_preparer.rb
lib/cocoapods/installer/pod_source_preparer.rb
+9
-6
pod_source_installer_spec.rb
spec/unit/installer/pod_source_installer_spec.rb
+7
-0
No files found.
lib/cocoapods/installer/pod_source_preparer.rb
View file @
e7ec75ee
...
@@ -58,12 +58,15 @@ module Pod
...
@@ -58,12 +58,15 @@ module Pod
return
unless
spec
.
prepare_command
return
unless
spec
.
prepare_command
UI
.
section
(
' > Running prepare command'
,
''
,
1
)
do
UI
.
section
(
' > Running prepare command'
,
''
,
1
)
do
Dir
.
chdir
(
path
)
do
Dir
.
chdir
(
path
)
do
ENV
.
delete
(
'CDPATH'
)
begin
ENV
[
'COCOAPODS_VERSION'
]
=
Pod
::
VERSION
ENV
.
delete
(
'CDPATH'
)
prepare_command
=
spec
.
prepare_command
.
strip_heredoc
.
chomp
ENV
[
'COCOAPODS_VERSION'
]
=
Pod
::
VERSION
full_command
=
"
\n
set -e
\n
"
+
prepare_command
prepare_command
=
spec
.
prepare_command
.
strip_heredoc
.
chomp
bash!
(
'-c'
,
full_command
)
full_command
=
"
\n
set -e
\n
"
+
prepare_command
ENV
.
delete
(
'COCOAPODS_VERSION'
)
bash!
(
'-c'
,
full_command
)
ensure
ENV
.
delete
(
'COCOAPODS_VERSION'
)
end
end
end
end
end
end
end
...
...
spec/unit/installer/pod_source_installer_spec.rb
View file @
e7ec75ee
...
@@ -63,6 +63,13 @@ module Pod
...
@@ -63,6 +63,13 @@ module Pod
@spec
.
prepare_command
=
"[
\"
$COCOAPODS_VERSION
\"
==
\"
#{
Pod
::
VERSION
}
\"
] || exit 1"
@spec
.
prepare_command
=
"[
\"
$COCOAPODS_VERSION
\"
==
\"
#{
Pod
::
VERSION
}
\"
] || exit 1"
lambda
{
@installer
.
install!
}.
should
.
not
.
raise
lambda
{
@installer
.
install!
}.
should
.
not
.
raise
end
end
it
'doesn\'t leak the $COCOAPODS_VERSION environment variable'
do
ENV
[
'COCOAPODS_VERSION'
]
=
nil
@spec
.
prepare_command
=
'exit 1'
lambda
{
@installer
.
install!
}.
should
.
raise
(
Pod
::
Informative
)
ENV
[
'COCOAPODS_VERSION'
].
should
.
be
.
nil
end
end
end
#--------------------------------------#
#--------------------------------------#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment