necktie 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/necktie/rake.rb +11 -15
- data/necktie.gemspec +1 -1
- metadata +1 -1
data/lib/necktie/rake.rb
CHANGED
@@ -14,26 +14,19 @@ module Necktie
|
|
14
14
|
standard_exception_handling do
|
15
15
|
init
|
16
16
|
repo = File.expand_path(".necktie")
|
17
|
-
|
17
|
+
if File.exist?(repo)
|
18
|
+
if options.pull
|
19
|
+
puts "Pulling latest updates ..."
|
20
|
+
sh "git pull origin #{ENV["BRANCH"] || "master"}", :verbose=>false
|
21
|
+
end
|
22
|
+
else
|
18
23
|
git_url = ENV["GIT_URL"] or fail "Need GIT_URL variable to point to Git repository, can't clone without it"
|
19
24
|
puts "Cloning #{git_url} to #{repo}"
|
20
|
-
sh "git clone #{git_url} #{repo.inspect}"
|
21
|
-
cloned = true
|
25
|
+
sh "git clone #{git_url} #{repo.inspect}", :verbose=>false
|
22
26
|
end
|
23
|
-
|
24
27
|
Dir.chdir repo do
|
25
28
|
load_rakefile
|
26
|
-
|
27
|
-
display_tasks_and_comments
|
28
|
-
elsif options.show_prereqs
|
29
|
-
display_prerequisites
|
30
|
-
else
|
31
|
-
unless cloned
|
32
|
-
puts "Pulling latest updates to #{repo}"
|
33
|
-
sh "git pull origin #{ENV["BRANCH"] || "master"}"
|
34
|
-
end
|
35
|
-
top_level_tasks.each { |task_name| invoke_task(task_name) }
|
36
|
-
end
|
29
|
+
top_level
|
37
30
|
end
|
38
31
|
end
|
39
32
|
end
|
@@ -90,6 +83,9 @@ module Necktie
|
|
90
83
|
Rake::TaskManager.record_task_metadata = true
|
91
84
|
}
|
92
85
|
],
|
86
|
+
['--update', '-u', "Update .necktie directory (git pull)",
|
87
|
+
lambda { |value| options.pull = true }
|
88
|
+
]
|
93
89
|
]
|
94
90
|
end
|
95
91
|
|
data/necktie.gemspec
CHANGED