Module: Dots::Installation
Constant Summary collapse
- REMOTE =
The Git remote we'll be pulling from. Set this in your
~/.zshenvto use a different fork of the project. ENV['DOTS_REMOTE'] || "origin"
Instance Method Summary collapse
- #copy_to_home_directory ⇒ Object
-
#pull_latest_changes ⇒ Object
Fetches and rebases the same code stored in
Dots.rootto~/.dots. -
#update_the_framework ⇒ Object
Attempts to update DOTS, but fails if changes are detected in the repo beforehand.
Instance Method Details
#copy_to_home_directory ⇒ Object
31 32 33 |
# File 'lib/ruby/dots/installation.rb', line 31 def copy_to_home_directory system "mkdir -p #{Dots.home} cp -R #{Dots.root} #{Dots.home}" end |
#pull_latest_changes ⇒ Object
Fetches and rebases the same code stored in Dots.root to
~/.dots. This essentially replays your own local changes on
top of the official updates to the framework. If you're using
a fork, you can set DOTS_REMOTE to the remote's name in
origin (this will default to your Github username, by the way).
40 41 42 |
# File 'lib/ruby/dots/installation.rb', line 40 def pull_latest_changes system "cd #{Dots.home} && #{git_pull}" end |
#update_the_framework ⇒ Object
Attempts to update DOTS, but fails if changes are detected in the repo beforehand.
The git ls-files -m command will return no results when there
are no modified files in the repo. This method blocks DOTS from
installing itself overtop of your committed changes, as well as
saves the user from an ugly Git error...
23 24 25 26 27 28 29 |
# File 'lib/ruby/dots/installation.rb', line 23 def update_the_framework if repo_is_clean? pull_latest_changes and run 'reload_dots' else say "You have uncommitted changes in ~/.dots. Please resolve them before updating." end end |