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
5b68d785
Commit
5b68d785
authored
Feb 24, 2015
by
Boris Bügling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Executable] Also support " by using `shellescape`
parent
116df746
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
executable.rb
lib/cocoapods/executable.rb
+2
-1
executable_spec.rb
spec/unit/executable_spec.rb
+2
-2
No files found.
lib/cocoapods/executable.rb
View file @
5b68d785
...
@@ -52,8 +52,9 @@ module Pod
...
@@ -52,8 +52,9 @@ module Pod
raise
Informative
,
"Unable to locate the executable `
#{
executable
}
`"
if
bin
.
empty?
raise
Informative
,
"Unable to locate the executable `
#{
executable
}
`"
if
bin
.
empty?
require
'open4'
require
'open4'
require
'shellwords'
full_command
=
"
\"
#{
bin
}
\"
#{
command
}
"
full_command
=
"
#{
bin
.
shellescape
}
#{
command
}
"
if
Config
.
instance
.
verbose?
if
Config
.
instance
.
verbose?
UI
.
message
(
"$
#{
full_command
}
"
)
UI
.
message
(
"$
#{
full_command
}
"
)
...
...
spec/unit/executable_spec.rb
View file @
5b68d785
...
@@ -11,12 +11,12 @@ module Pod
...
@@ -11,12 +11,12 @@ module Pod
end
end
it
'should support spaces in the full path of the command'
do
it
'should support spaces in the full path of the command'
do
cmd
=
'/Spa ces/are/fun/false'
cmd
=
'/Spa ces/are
"
/fun/false'
Executable
.
stubs
(
:`
).
returns
(
cmd
)
Executable
.
stubs
(
:`
).
returns
(
cmd
)
result
=
mock
result
=
mock
result
.
stubs
(
:success?
).
returns
(
true
)
result
.
stubs
(
:success?
).
returns
(
true
)
Open4
.
expects
(
:spawn
).
with
(
"
\"
#{
cmd
}
\"
"
,
:stdout
=>
[],
:stderr
=>
[],
:status
=>
true
).
once
.
returns
(
result
)
Open4
.
expects
(
:spawn
).
with
(
'/Spa\\ ces/are\\"/fun/false '
,
:stdout
=>
[],
:stderr
=>
[],
:status
=>
true
).
once
.
returns
(
result
)
Executable
.
execute_command
(
cmd
,
''
,
true
)
Executable
.
execute_command
(
cmd
,
''
,
true
)
end
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