mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-06-11 00:09:38 +08:00
[Instruments] Ensure we only deal with the templates part of the output.
This commit is contained in:
@@ -301,7 +301,12 @@ EOS
|
||||
if File.exist?(template)
|
||||
template_path = template
|
||||
elsif !builtin_templates.grep(/#{template}/i).empty?
|
||||
list = `#{locate_binary('instruments')} -s 2>&1`.strip.split("\n").map { |line| line.sub(/^\s*"/, '').sub(/",*$/, '') }
|
||||
# Get a list of just the templates (ignoring devices)
|
||||
list = `#{locate_binary('instruments')} -s 2>&1`.strip.split("\n")
|
||||
start = list.index('Known Templates:') + 1
|
||||
list = list[start..-1]
|
||||
# Only interested in the template (file base) names
|
||||
list.map! { |line| line.sub(/^\s*"/, '').sub(/",*$/, '') }
|
||||
template = template.downcase
|
||||
template_path = list.find { |path| File.basename(path, File.extname(path)).downcase == template }
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user