thor-tropo 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/thor-tropo.rb +8 -7
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0
|
1
|
+
1.1.0
|
data/lib/thor-tropo.rb
CHANGED
@@ -18,6 +18,9 @@ module ThorTropo
|
|
18
18
|
include Thor::Actions
|
19
19
|
|
20
20
|
@packaged_cookbook = nil
|
21
|
+
|
22
|
+
namespace "tropo"
|
23
|
+
|
21
24
|
class_option :called_path,
|
22
25
|
:type => :string,
|
23
26
|
:default => Dir.pwd
|
@@ -27,8 +30,6 @@ module ThorTropo
|
|
27
30
|
:aliases => "-v",
|
28
31
|
:default => false
|
29
32
|
|
30
|
-
namespace "tropo"
|
31
|
-
|
32
33
|
method_option :force,
|
33
34
|
:type => :boolean,
|
34
35
|
:aliases => "-f",
|
@@ -42,7 +43,7 @@ module ThorTropo
|
|
42
43
|
:default => false,
|
43
44
|
:desc => "NO-OP mode, dont actually upload anything"
|
44
45
|
|
45
|
-
method_option :
|
46
|
+
method_option :ignore_dirty,
|
46
47
|
:type => :boolean,
|
47
48
|
:aliases => "-i",
|
48
49
|
:default => false,
|
@@ -62,8 +63,8 @@ module ThorTropo
|
|
62
63
|
|
63
64
|
$config = ThorTropo::Configuration.new(options[:called_path])
|
64
65
|
|
65
|
-
unless
|
66
|
-
unless
|
66
|
+
unless clean?
|
67
|
+
unless options[:ignore_dirty]
|
67
68
|
say "There are files that need to be committed first.", :red
|
68
69
|
exit 1
|
69
70
|
end
|
@@ -102,14 +103,14 @@ module ThorTropo
|
|
102
103
|
end
|
103
104
|
|
104
105
|
def clean?
|
105
|
-
sh_with_excode("git diff --exit-
|
106
|
+
sh_with_excode("cd #{options[:called_path]}; git diff --exit-code")[1] == 0
|
106
107
|
end
|
107
108
|
|
108
109
|
def clean_lockfile
|
109
110
|
berksfile = "#{options[:called_path]}/Berksfile.lock"
|
110
111
|
|
111
112
|
if File.exists? berksfile
|
112
|
-
say "[ TROPO ] - Removing Berksfile.lock before running Berkshelf", :
|
113
|
+
say "[ TROPO ] - Removing Berksfile.lock before running Berkshelf", :blue
|
113
114
|
remove_file berksfile
|
114
115
|
else
|
115
116
|
say "[ TROPO ] - Unable to find berksfile to delete - [ #{berksfile} ]", :yellow
|