canzea 0.1.107 → 0.1.108
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/commands/config-git-commit.rb +35 -28
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1c154149608246d765d96d0023c8fb0635cca27
|
4
|
+
data.tar.gz: fd3b9d1b4e737d5c2eacceb781d63c6b267c6869
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 548a7d2ecd143697731eb0a4e49ab5da4fa7a8d0800edc18bc214e865c8ac54314d881300352e49f2ba37c417c920b65f2d27f5a077d11f63ae058c0447eda39
|
7
|
+
data.tar.gz: 2cde88c9525282d5337856fe16cd62d26fb9451d95c792b61aecc166e25d07fe2ea6219651e2b81a67305d86c04cecfd3ee94b1bf63936a58e6c377cc3e5bf73
|
data/lib/canzea/version.rb
CHANGED
@@ -4,43 +4,50 @@ require "pathname"
|
|
4
4
|
|
5
5
|
class ConfigGitCommit
|
6
6
|
def do(gitRoot, sourcePath, template, parameters)
|
7
|
-
|
7
|
+
begin
|
8
|
+
# if file exists on file system and does not exist in gitRoot, then commit the "oem" file
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
if (File.exists?(sourcePath))
|
11
|
+
dest = "#{gitRoot}/config#{Pathname.new(sourcePath).realpath}"
|
12
|
+
else
|
13
|
+
dest = "#{gitRoot}/config#{sourcePath}"
|
14
|
+
end
|
15
|
+
puts "Writing to #{dest}"
|
16
|
+
|
17
|
+
if (File.exist?(dest) == false and File.exist?(sourcePath))
|
18
|
+
FileUtils.mkdir_p Pathname.new(dest).dirname
|
19
|
+
FileUtils.cp sourcePath, dest
|
15
20
|
|
16
|
-
|
21
|
+
puts "Recording in repo the default file first: #{sourcePath}"
|
22
|
+
if (Canzea::config[:track_changes_in_git])
|
23
|
+
g = Git.init(gitRoot)
|
24
|
+
g.add(:all=>true)
|
25
|
+
g.commit("Original default #{sourcePath}")
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
if template
|
30
|
+
puts "Processing template #{template}"
|
31
|
+
FileUtils.mkdir_p Pathname.new(sourcePath).dirname
|
32
|
+
t = Template.new
|
33
|
+
t.processAndWriteToFile template, sourcePath, parameters
|
34
|
+
end
|
17
35
|
FileUtils.mkdir_p Pathname.new(dest).dirname
|
18
36
|
FileUtils.cp sourcePath, dest
|
19
37
|
|
20
|
-
puts "Recording in repo the default file first: #{sourcePath}"
|
21
38
|
if (Canzea::config[:track_changes_in_git])
|
22
39
|
g = Git.init(gitRoot)
|
23
40
|
g.add(:all=>true)
|
24
|
-
g.
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
if template
|
29
|
-
puts "Processing template #{template}"
|
30
|
-
FileUtils.mkdir_p Pathname.new(sourcePath).dirname
|
31
|
-
t = Template.new
|
32
|
-
t.processAndWriteToFile template, sourcePath, parameters
|
33
|
-
end
|
34
|
-
FileUtils.mkdir_p Pathname.new(dest).dirname
|
35
|
-
FileUtils.cp sourcePath, dest
|
36
|
-
|
37
|
-
if (Canzea::config[:track_changes_in_git])
|
38
|
-
g = Git.init(gitRoot)
|
39
|
-
g.add(:all=>true)
|
40
|
-
puts g.status.changed.size() + g.status.added.size()
|
41
|
-
if (g.status.changed.size() > 0 or g.status.added.size() > 0)
|
42
|
-
g.commit("Config update #{sourcePath}")
|
41
|
+
puts g.status.changed.size() + g.status.added.size()
|
42
|
+
if (g.status.changed.size() > 0 or g.status.added.size() > 0)
|
43
|
+
g.commit("Config update #{sourcePath}")
|
44
|
+
end
|
43
45
|
end
|
46
|
+
rescue => exception
|
47
|
+
@log.error("ConfigGitCommit Failed")
|
48
|
+
@log.error(exception.to_s)
|
49
|
+
@log.error(exception.backtrace)
|
50
|
+
abort()
|
44
51
|
end
|
45
52
|
end
|
46
53
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: canzea
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.108
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Canzea Technologies
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|