diff --git a/Cargo.lock b/Cargo.lock index 1c63004c..ed6f09d1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -212,7 +212,7 @@ dependencies = [ [[package]] name = "mcfly" -version = "0.2.0" +version = "0.2.1" dependencies = [ "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", "csv 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 3e6589af..7afc1b0e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mcfly" -version = "0.2.0" +version = "0.2.1" authors = ["Andrew Cantino "] [profile.release] diff --git a/README.md b/README.md index 9d80a6b4..c0dcadf9 100644 --- a/README.md +++ b/README.md @@ -39,13 +39,13 @@ When suggesting a command, McFly takes into consideration: ```bash brew install mcfly ``` -1. Add the following to your `~/.bash_profile` or `~/.bashrc` file: +1. Add the following to your `~/.bash_profile` (OS X) or `~/.bashrc` (Linux) file: ```bash - if [ -f /usr/local/opt/mcfly/mcfly-bash.sh ]; then - . /usr/local/opt/mcfly/mcfly-bash.sh + if [ -f $(brew --prefix)/opt/mcfly/mcfly-bash.sh ]; then + . $(brew --prefix)/opt/mcfly/mcfly-bash.sh fi ``` -1. Run `. ~/.bash_profile` / `. ~/.bashrc` or restart your terminal emulator. +1. Run `. ~/.bash_profile` (OS X) / `. ~/.bashrc` (Linux) or restart your terminal emulator. #### Uninstalling with Homebrew @@ -57,14 +57,14 @@ When suggesting a command, McFly takes into consideration: ```bash brew untap cantino/mcfly ``` -1. Remove the lines you added to `~/.bash_profile` / `~/.bashrc`. +1. Remove the lines you added to `~/.bash_profile` or `~/.bashrc`. ### Installing manually from GitHub 1. Download the [latest release from GitHub](https://github.com/cantino/mcfly/releases). 1. Install to a location in your `$PATH`. (For example, you could create a directory at `~/bin`, copy `mcfly` to this location, and add `export PATH="$PATH:$HOME/bin"` to your `.bash_profile`.) 1. Copy `mcfly-bash.sh` to a known location. -1. Add the following to your `~/.bash_profile` or `~/.bashrc` file: +1. Add the following to your `~/.bash_profile` (OS X) or `~/.bashrc` (Linux) file: ```bash if [ -f /path/to/mcfly-bash.sh ]; then . /path/to/mcfly-bash.sh @@ -78,7 +78,7 @@ When suggesting a command, McFly takes into consideration: 1. Run `git clone https://github.com/cantino/mcfly` and `cd mcfly` 1. Run `cargo install --path .` 1. Ensure `~/.cargo/bin` is in your `$PATH`. -1. Add the following to your `~/.bash_profile` or `~/.bashrc` file: +1. Add the following to your `~/.bash_profile` (OS X) or `~/.bashrc` (Linux) file: ```bash if [ -f /path/to/mcfly-bash.sh ]; then . /path/to/mcfly-bash.sh diff --git a/pkg/brew/mcfly.rb b/pkg/brew/mcfly.rb index d6f79ec6..ea6c933e 100644 --- a/pkg/brew/mcfly.rb +++ b/pkg/brew/mcfly.rb @@ -22,5 +22,9 @@ class Mcfly < Formula def install prefix.install "mcfly-bash.sh" bin.install "mcfly" + ohai "To finish installing mcfly, add the following to your ~/.bash_profile (OS X) or ~/.bashrc (Linux) file: +if [ -f $(brew --prefix)/opt/mcfly/mcfly-bash.sh ]; then + . $(brew --prefix)/opt/mcfly/mcfly-bash.sh +fi".strip end end