Skip to content

Commit

Permalink
Fix shell escape of llvm-cov path and arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
AliSoftware committed Sep 21, 2015
1 parent 8aa1c12 commit 4d0199a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/slather/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
require 'xcodeproj'
require 'json'
require 'yaml'
require 'shellwords'

module Xcodeproj
class Project
Expand Down Expand Up @@ -111,8 +112,9 @@ def profdata_llvm_cov_output
raise StandardError, "No Coverage.profdata files found. Please make sure the \"Code Coverage\" checkbox is enabled in your scheme's Test action or the build_directory property is set."
end
xcode_path = `xcode-select -p`.strip
llvm_cov_command = File.join(xcode_path, "Toolchains/XcodeDefault.xctoolchain/usr/bin/llvm-cov show -instr-profile #{coverage_profdata} #{binary_file}")
`#{llvm_cov_command}`
llvm_cov_path = File.join(xcode_path, "Toolchains/XcodeDefault.xctoolchain/usr/bin/llvm-cov")
llvm_cov_args = %W(show -instr-profile #{coverage_profdata} #{binary_file})
`#{llvm_cov_path.shellescape} #{llvm_cov_args.shelljoin}`
end
private :profdata_llvm_cov_output

Expand Down

0 comments on commit 4d0199a

Please sign in to comment.