canzea 0.1.172 → 0.1.173
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/canzea/version.rb +1 -1
- data/lib/canzea.rb +5 -0
- data/lib/commands/get-catalog.rb +16 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec88a18306083c65200833f06ce240837b8cfa8c
|
4
|
+
data.tar.gz: b928be1c4dd7b84679e947abc44c177a340951fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77394dad1c1eb37d611b54534ea7c671cd39914149452fd32d070d413e58cbbdde0dc3a5fafa19fc08094f2771fe57088eb163731c8fd69c192ccbf14f327c71
|
7
|
+
data.tar.gz: 4c324ddc283e937930f4420a805f3fbb3605f79ac5a525e3dc32eaca100a0e3026502583a49168f4ab5cec355a895abc1fcaa1be070e6afcc1565e73f4ffd159
|
data/lib/canzea/version.rb
CHANGED
data/lib/canzea.rb
CHANGED
@@ -57,6 +57,7 @@ module Canzea
|
|
57
57
|
# flag nil, :enable, 'Enable the service'
|
58
58
|
flag nil, :test, 'Run as a test'
|
59
59
|
flag nil, :reset, 'Refresh catalog to latest'
|
60
|
+
flag nil, :checkout, 'Checkout catalog to latest'
|
60
61
|
flag nil, :fv, 'Show version and the catalog version'
|
61
62
|
flag nil, :config_git_commit, 'Manage configuration files in git'
|
62
63
|
|
@@ -116,6 +117,10 @@ module Canzea
|
|
116
117
|
GetCatalog.new.do(opts.fetch(:catalogTag, nil));
|
117
118
|
end
|
118
119
|
|
120
|
+
if (opts[:checkout])
|
121
|
+
GetCatalog.new.checkout(opts.fetch(:catalogTag, nil));
|
122
|
+
end
|
123
|
+
|
119
124
|
GetCatalog.new.state
|
120
125
|
|
121
126
|
if (opts[:fv])
|
data/lib/commands/get-catalog.rb
CHANGED
@@ -8,6 +8,7 @@ class GetCatalog
|
|
8
8
|
def initialize ()
|
9
9
|
@log = Logger.new(Canzea::config[:logging_root] + '/plans.log')
|
10
10
|
end
|
11
|
+
|
11
12
|
def do(tag = nil)
|
12
13
|
catalogLocation = Canzea::config[:catalog_location]
|
13
14
|
FileUtils.rm_rf "#{catalogLocation}"
|
@@ -25,6 +26,21 @@ class GetCatalog
|
|
25
26
|
puts "-- (RESET) Source #{catalogLocation}/catalog"
|
26
27
|
end
|
27
28
|
|
29
|
+
def checkout(tag = nil)
|
30
|
+
catalogLocation = Canzea::config[:catalog_location]
|
31
|
+
catalogLocation = Pathname.new(catalogLocation).parent().realpath
|
32
|
+
g = Git.open(Canzea::config[:catalog_location])
|
33
|
+
if (tag != nil)
|
34
|
+
puts "-- (RESET) For tag #{tag}"
|
35
|
+
g.checkout(tag)
|
36
|
+
else
|
37
|
+
g.checkout(g.branch(Canzea::config[:catalog_branch]))
|
38
|
+
end
|
39
|
+
branch = g.current_branch
|
40
|
+
puts "-- (RESET) Branch '#{branch}' Commit #{g.log[0]}"
|
41
|
+
puts "-- (RESET) Source #{catalogLocation}/catalog"
|
42
|
+
end
|
43
|
+
|
28
44
|
def state()
|
29
45
|
g = Git.open(Canzea::config[:catalog_location])
|
30
46
|
|