Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated for a few niceties #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ It slows the process down slightly, and therefore defaults to `false`.

If you're even lazier, you can tell `git-up` to run `bundle install` for you if it finds missing gems. Make sure `git-up.bundler.check` is also set to `true` or it won't do anything.

### `git-up.bundler.local [true|false]`

If you've `bundle package`-ed your project gems, you can tell `git-up` to run `bundle install --local` for you if it finds missing gems. Much faster than just a plain old `bundle install`. Don't worry if you're missing gems, it will backtrack to `bundle install` if anything goes wrong. Make sure `git-up.bundler.autoinstall` is also set to `true` or it won't do anything.

### `git-up.bundler.rbenv [true|false]`

If you have rbenv installed, you can tell `git-up` to run `rbenv rehash` for you after it installs your gems so any binaries will be available right away. Make sure `git-up.bundler.autoinstall` is also set to `true` or it won't do anything.

### `git-up.fetch.prune [true|false]`

By default, `git-up` will append the `--prune` flag to the `git fetch` command if your git version supports it (1.6.6 or greater), telling it to [remove any remote tracking branches which no longer exist on the remote](http://linux.die.net/man/1/git-fetch). Set this option to `false` to disable it.
Expand Down
6 changes: 3 additions & 3 deletions RVM.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ ruby interpreter in the environment, and the way git interprets and
executes `git up`.

When you run `git [some command]` git will first look internally to see
if it can fulfil the command, then it will attempt to "shell out" and run
if it can fulfill the command, then it will attempt to "shell out" and run
whatever `git-[some command]` executable it can find in your $PATH.

When git "shells out" all of the environmental variables will be
exposed, and it will be able to find our `git-up` executable in the $PATH.
However because of the way RVM magically sets your ruby interpreter,
when `git-up` is ran `ruby` still points to the non-RVM system default.
when `git-up` is run `ruby` still points to the non-RVM system default.

workaround
----------

To fix this we need to make sure that RVM gets to do it's business
before `git-up` is ran.
before `git-up` is run.

RVM provides a handy way of doing this called "wrappers", so let's
generate a wrapper for git-up like so:
Expand Down
17 changes: 15 additions & 2 deletions lib/git-up.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,21 @@ def check_bundler
print 'Gems are missing. '.yellow

if config("bundler.autoinstall") == 'true'
puts "Running `bundle install`.".yellow
system "bundle", "install"
if config("bundler.local") == 'true'
puts "Running `bundle install --local`.".yellow
unless system "bundle", "install", "--local"
puts "Problem running `bundle install --local`. Running `bundle install` instead.".yellow
system "bundle", "install"
end
else
puts "Running `bundle install`.".yellow
system "bundle", "install"
end

if config("bundler.rbenv") == 'true'
puts "Running `rbenv rehash`.".yellow
system "rbenv", "rehash"
end
else
puts "You should `bundle install`.".yellow
end
Expand Down
2 changes: 1 addition & 1 deletion lib/git-up/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class GitUp
VERSION = "0.5.8"
VERSION = "0.5.9"
end