Sha256: 1e8109cc353621f314e63987eaaf283eed306314a531223538e46a6f967279f8

Contents?: true

Size: 517 Bytes

Versions: 71

Compression:

Stored size: 517 Bytes

Contents

require 'fileutils'
class Subspace::Commands::Override < Subspace::Commands::Base
  def initialize(args, options)
    @role = args.first
    run
  end

  def run
    role_src = File.join gem_path, "ansible", "roles", @role
    if !File.exist? role_src
      say "Error, no such role #{@role}"
      exit
    end
    dest = File.join dest_dir, 'roles', @role
    if File.exist? dest
      say "Error, cowardly refusing to overwrite #{dest} - file exists"
      exit
    end
    FileUtils.cp_r role_src, dest
  end
end

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
subspace-2.5.1 lib/subspace/commands/override.rb
subspace-2.5 lib/subspace/commands/override.rb
subspace-2.4.2 lib/subspace/commands/override.rb
subspace-2.4.1 lib/subspace/commands/override.rb
subspace-2.4.0 lib/subspace/commands/override.rb
subspace-2.3.3 lib/subspace/commands/override.rb
subspace-2.3.2 lib/subspace/commands/override.rb
subspace-2.3.1 lib/subspace/commands/override.rb
subspace-2.3.0 lib/subspace/commands/override.rb
subspace-2.2.3 lib/subspace/commands/override.rb
subspace-2.2.2 lib/subspace/commands/override.rb
subspace-2.2.1 lib/subspace/commands/override.rb
subspace-2.2.0 lib/subspace/commands/override.rb
subspace-2.1.2 lib/subspace/commands/override.rb
subspace-2.1.1 lib/subspace/commands/override.rb
subspace-2.1.0 lib/subspace/commands/override.rb
subspace-2.0.4 lib/subspace/commands/override.rb
subspace-2.0.3 lib/subspace/commands/override.rb
subspace-2.0.2 lib/subspace/commands/override.rb
subspace-2.0.1 lib/subspace/commands/override.rb