From fe504881d312ed1de13979338f9a8bb7c805884a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Thu, 3 Oct 2013 11:08:30 +0200 Subject: [PATCH] update installation instructions to prefer `rake install` Don't suggest standalone install via curl anymore because: - hub may not be a single script in the near future - `rake install` handles the Windows executable as well --- README.md | 30 +++++++++++------------------- Rakefile | 4 +++- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index affe37cad..b21d57387 100644 --- a/README.md +++ b/README.md @@ -31,16 +31,21 @@ Installing on OS X is easiest with Homebrew: $ brew install hub ~~~ -### Standalone +### `rake install` from source -`hub` is easily installed as a standalone script: +This is the preferred installation method without when no package manager that +supports hub is available: ~~~ sh -$ curl http://hub.github.com/standalone -sLo ~/bin/hub && - chmod +x ~/bin/hub +# Download or clone the project from GitHub: +$ git clone git://github.com/github/hub.git +$ cd hub +$ rake install ~~~ -Assuming "~/bin/" is in your `$PATH`, you're ready to roll: +On a Unix-based OS, this installs under `PREFIX`, which is `/usr/local` by default. + +Now you should be ready to roll: ~~~ sh $ hub version @@ -48,10 +53,7 @@ git version 1.7.6 hub version 1.8.3 ~~~ -#### On Windows - -If you have mysysgit, open "Git Bash" and follow the steps above but put the -`hub` executable in `/bin` instead of `~/bin`. +#### Windows "Git Bash" (mysysgit) note Avoid aliasing hub as `git` due to the fact that mysysgit automatically configures your prompt to include git information, and you want to avoid slowing @@ -78,16 +80,6 @@ $ hub hub standalone > ~/bin/hub && chmod +x ~/bin/hub This installs a standalone version which doesn't require RubyGems to run, so it's faster. -### Source - -You can also install from source: - -~~~ sh -$ git clone git://github.com/github/hub.git -$ cd hub -$ rake install prefix=/usr/local -~~~ - ### Help! It's slow! #### Is `hub` noticeably slower than plain git? diff --git a/Rakefile b/Rakefile index bf4d84fe4..04d32e98b 100644 --- a/Rakefile +++ b/Rakefile @@ -104,7 +104,9 @@ end desc "Build standalone script" task :standalone => "hub" -desc "Install standalone script and man pages if unix-based OS. If Windows, install executable and .bat file inside ruby/bin" +desc %{Install standalone script and man page. +On Unix-based OS, installs into PREFIX (default: `/usr/local`). +On Windows, installs into Ruby's main bin directory.} task :install => "hub" do require 'rbconfig' if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/