Sha256: 745d0161ba5986c8641ee33a0b77e690cbe01ae68e690217c2c1d4a7f042cd58

Contents?: true

Size: 1.03 KB

Versions: 18

Compression:

Stored size: 1.03 KB

Contents

require "fileutils"
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(File.expand_path("~/.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
      FileUtils.touch(File.expand_path("~/.bash_profile"))
      append_to_file "~/.bash_profile", "source ~/.codelation/bash/.codelation.bash"
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
codelation-cli-0.0.23 lib/codelation/development/dot_files.rb
codelation-cli-0.0.22 lib/codelation/development/dot_files.rb
codelation-cli-0.0.21 lib/codelation/development/dot_files.rb
codelation-cli-0.0.20 lib/codelation/development/dot_files.rb
codelation-cli-0.0.19 lib/codelation/development/dot_files.rb
codelation-cli-0.0.18 lib/codelation/development/dot_files.rb
codelation-cli-0.0.17 lib/codelation/development/dot_files.rb
codelation-cli-0.0.16 lib/codelation/development/dot_files.rb
codelation-cli-0.0.15 lib/codelation/development/dot_files.rb
codelation-cli-0.0.14 lib/codelation/development/dot_files.rb
codelation-cli-0.0.13 lib/codelation/development/dot_files.rb
codelation-cli-0.0.12 lib/codelation/development/dot_files.rb
codelation-cli-0.0.11 lib/codelation/development/dot_files.rb
codelation-cli-0.0.10 lib/codelation/development/dot_files.rb
codelation-cli-0.0.9 lib/codelation/development/dot_files.rb
codelation-cli-0.0.8 lib/codelation/development/dot_files.rb
codelation-cli-0.0.7 lib/codelation/development/dot_files.rb
codelation-cli-0.0.6 lib/codelation/development/dot_files.rb