Skip to content

Commit

Permalink
Make install non-destructive by default
Browse files Browse the repository at this point in the history
  • Loading branch information
rodjek committed Aug 3, 2012
1 parent d5125be commit dc08ea7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lib/librarian/puppet/cli.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/librarian/puppet/version.rb
@@ -1,5 +1,5 @@
module Librarian
module Puppet
VERSION = "0.9.1"
VERSION = "0.9.2"
end
end
6 changes: 5 additions & 1 deletion vendor/librarian/lib/librarian/action/install.rb
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit dc08ea7

Please sign in to comment.