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-3.0.12 lib/subspace/commands/override.rb
subspace-3.0.11 lib/subspace/commands/override.rb
subspace-3.0.10 lib/subspace/commands/override.rb
subspace-3.0.9 lib/subspace/commands/override.rb
subspace-3.0.6 lib/subspace/commands/override.rb
subspace-3.0.5 lib/subspace/commands/override.rb
subspace-3.0.4 lib/subspace/commands/override.rb
subspace-3.0.3 lib/subspace/commands/override.rb
subspace-3.0.2 lib/subspace/commands/override.rb
subspace-3.0.0 lib/subspace/commands/override.rb
subspace-2.5.10 lib/subspace/commands/override.rb
subspace-3.0.0.rc1 lib/subspace/commands/override.rb
subspace-2.5.9 lib/subspace/commands/override.rb
subspace-2.5.8 lib/subspace/commands/override.rb
subspace-2.5.7 lib/subspace/commands/override.rb
subspace-2.5.6 lib/subspace/commands/override.rb
subspace-2.5.5 lib/subspace/commands/override.rb
subspace-2.5.4 lib/subspace/commands/override.rb
subspace-2.5.3 lib/subspace/commands/override.rb
subspace-2.5.2 lib/subspace/commands/override.rb