Commit 9fa7a8ac authored by Nolan Waite's avatar Nolan Waite

Stop adding duplicates to workspace

parent 10352507
...@@ -105,7 +105,8 @@ module Pod ...@@ -105,7 +105,8 @@ module Pod
pods_projpath = File.join(config.project_pods_root, 'Pods.xcodeproj') pods_projpath = File.join(config.project_pods_root, 'Pods.xcodeproj')
root = Pathname.new(root).expand_path root = Pathname.new(root).expand_path
[projpath, pods_projpath].each do |path| [projpath, pods_projpath].each do |path|
workspace << Pathname.new(path).expand_path.relative_path_from(root) path = Pathname.new(path).expand_path.relative_path_from(root).to_s
workspace << path unless workspace.include? path
end end
workspace.save_as(xcworkspace) workspace.save_as(xcworkspace)
......
...@@ -30,6 +30,10 @@ module Pod ...@@ -30,6 +30,10 @@ module Pod
@projpaths << projpath @projpaths << projpath
end end
def include?(projpath)
@projpaths.include?(projpath)
end
TEMPLATE = %q[<?xml version="1.0" encoding="UTF-8"?><Workspace version="1.0"></Workspace>] TEMPLATE = %q[<?xml version="1.0" encoding="UTF-8"?><Workspace version="1.0"></Workspace>]
def to_s def to_s
doc = NSXMLDocument.alloc.initWithXMLString(TEMPLATE, options:0, error:nil) doc = NSXMLDocument.alloc.initWithXMLString(TEMPLATE, options:0, error:nil)
......
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