Permalink
Browse files

Make install non-destructive by default

  • Loading branch information...
1 parent d5125be commit dc08ea73b80db69bcd48932a8b6555396098a6f2 @rodjek committed Aug 3, 2012
@@ -42,9 +42,13 @@ def init
option "clean", :type => :boolean, :default => false
option "strip-dot-git", :type => :boolean
option "path", :type => :string
+ option "destructive", :type => :boolean, :default => false
def install
ensure!
clean! if options["clean"]
+ unless options["destructive"].nil?
+ environment.config_db.local['destructive'] = options['destructive'].to_s
+ end
if options.include?("strip-dot-git")
strip_dot_git_val = options["strip-dot-git"] ? "1" : nil
environment.config_db.local["install.strip-dot-git"] = strip_dot_git_val
@@ -1,5 +1,5 @@
module Librarian
module Puppet
- VERSION = "0.9.1"
+ VERSION = "0.9.2"
end
end
@@ -40,7 +40,7 @@ def perform_installation
end
def create_install_path
- install_path.rmtree if install_path.exist?
+ install_path.rmtree if install_path.exist? && destructive?
install_path.mkpath
end
@@ -54,6 +54,10 @@ def sorted_manifests
ManifestSet.sort(lock.manifests)
end
+ def destructive?
+ environment.config_db.local['destructive'] == 'true'
+ end
+
def specfile_name
environment.specfile_name
end

0 comments on commit dc08ea7

Please sign in to comment.