Skip to content
This repository has been archived by the owner on Jul 2, 2018. It is now read-only.

Commit

Permalink
Fix a bug that command seeds after targets won't be installed.
Browse files Browse the repository at this point in the history
  • Loading branch information
devxoul committed May 13, 2015
1 parent 045c0ad commit bc10c56
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/cocoaseeds/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,27 +73,28 @@ def analyze_dependencies
end

def execute_seedfile
@current_target_name = nil

def target(*names, &code)
names.each do |name|
name = name.to_s # use string instead of symbol
@current_target_name = name

target = self.project.target_named(name)
if not target
raise Seeds::Exception.new\
"#{self.project.path.basename} doesn't have a target `#{name}`"
end

@current_target_name = name
code.call()
end
@current_target_name = nil
end

def github(repo, tag, options={})
if not @current_target_name # apply to all targets
target *self.project.targets.map(&:name) do
send(__callee__, repo, tag, options)
end
@current_target_name = nil
else
seed = Seeds::Seed::GitHub.new
seed.url = "https://github.com/#{repo}"
Expand All @@ -110,7 +111,6 @@ def github(repo, tag, options={})
end

eval seedfile
@current_target_name = nil
end

def remove_seeds
Expand Down

0 comments on commit bc10c56

Please sign in to comment.