raykit 0.0.152 → 0.0.153
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/raykit/console.rb +29 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb92bd4b230c24678ca4790c19ade36f6f739815b1f3c62de64c8ad8422b5b6b
|
4
|
+
data.tar.gz: eb5e79b969aa3733c750c5145b297534265a3afe04f89dbf8e675e66f4bac804
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06ea87f13ac4a5a072ecd16d1a712a12864713d8abd857fee03f37b78a3162b07d2a9ebaee4fd788ce6dbc201176ccbb69c4370d5c186a819e6b905fae19692a
|
7
|
+
data.tar.gz: '09c8272dd20c8812bdbec3faee214d947f8b4e316ff35cf3d7262d3480237eaf76dbd751ddef64bc4e7c918e8634c88e4d584cc87c9183a87e5df59a19fe7756'
|
data/lib/raykit/console.rb
CHANGED
@@ -9,6 +9,8 @@ module Raykit
|
|
9
9
|
def initialize
|
10
10
|
@opts = Slop.parse do |o|
|
11
11
|
o.string '-t','--task','rake task', default: 'default'
|
12
|
+
o.bool '-v','--verbose','print detailed output', default: false
|
13
|
+
o.bool '-q','--quit','quit on failure', default: true
|
12
14
|
end
|
13
15
|
|
14
16
|
if(opts.verbose?)
|
@@ -149,11 +151,33 @@ module Raykit
|
|
149
151
|
pattern=''
|
150
152
|
pattern=@opts.arguments[1] if(@opts.arguments.length > 1)
|
151
153
|
REPOSITORIES.matches(pattern).each{|url|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
154
|
+
begin
|
155
|
+
repo=Raykit::Git::Repository.new(url)
|
156
|
+
work=Raykit::Git::Directory.new(repo.get_dev_dir('work'))
|
157
|
+
if(Dir.exist?(work.directory))
|
158
|
+
#puts work.directory
|
159
|
+
#work.pull
|
160
|
+
|
161
|
+
Dir.chdir(work.directory) do
|
162
|
+
diff=`git diff`.strip
|
163
|
+
status=`git status`.strip
|
164
|
+
if(diff.length == 0 && status.include?('nothing to commit'))
|
165
|
+
cmd = Command.new('git pull')
|
166
|
+
cmd.summary if(@opts.verbose?)
|
167
|
+
|
168
|
+
if(cmd.exitstatus != 0)
|
169
|
+
puts cmd.output
|
170
|
+
puts cmd.error
|
171
|
+
puts
|
172
|
+
if(@opts.quit?)
|
173
|
+
abort Rainbow(elapsed_str).red.bright + " " + Rainbow(cmd.command).white
|
174
|
+
end
|
175
|
+
end
|
176
|
+
end
|
177
|
+
end
|
178
|
+
end
|
179
|
+
rescue
|
180
|
+
puts 'error occurred for pull of ' + url
|
157
181
|
end
|
158
182
|
}
|
159
183
|
end
|