Sha256: dbae48580d138500d552e36918ad032444a25864ccb887da9b54a02a5cfaa65f

Contents?: true

Size: 953 Bytes

Versions: 3

Compression:

Stored size: 953 Bytes

Contents

require "thor"

module Codelation
  class Cli < Thor
  private

    # Install dot files and load them into ~/.bash_profile
    def install_dot_files
      # Create the directory ~/.codelation/bash if it doesn't exist
      FileUtils.mkdir_p("~/.codelation/bash")

      # Copy dot files to ~/.codelation
      copy_file "dot_files/.codelation.bash",     "~/.codelation/bash/.codelation.bash"
      copy_file "dot_files/.git-completion.bash", "~/.codelation/bash/.git-completion.bash"
      copy_file "dot_files/.git-prompt.sh",       "~/.codelation/bash/.git-prompt.sh"
      copy_file "dot_files/.jshintrc",            "~/.jshintrc"
      copy_file "dot_files/.rubocop.yml",         "~/.rubocop.yml"
      copy_file "dot_files/.scss-lint.yml",       "~/.scss-lint.yml"

      # Add `source ~/.codelation.bash` to ~/.bash_profile if it doesn't exist
      append_to_file "~/.bash_profile", "source ~/.codelation/bash/.codelation.bash"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
codelation-cli-0.0.4 lib/codelation/development/dot_files.rb
codelation-cli-0.0.3 lib/codelation/development/dot_files.rb
codelation-cli-0.0.2 lib/codelation/development/dot_files.rb