Context
-------

I have some functions defined in my `~/.bashrc` which I'd like to turn into a Homebrew package. Currently, these functions act as custom commands on my command line:

```sh
# .bashrc
function foo() {
    # do something interesting
}

# at terminal
$ foo
# => does the interesting thing

```

Approach
--------

I've created a homebrew formula using `brew create`. My current approach is as follows:

1. Move the function definitions into a separate file, `script`, within a directory, `brew-script`
2. Make `brew-script` downloadable as a tarball, `brew-script.tar.gz`
3. Have my brew formula append text to the end of `~/.bash_profile` to include `script` when terminal session starts

Concerns
--------

1. Is modifying `.bash_profile` in a brew formula bad practice? (eg. when uninstalling with `brew uninstall script`, brew should somehow remove the text that was appended to `.bash_profile`... Parsing `.bash_profile` doesn't seem very fun.)
2. Is there a convention already established for including functions in bash scripts so that they are available from the command line?
3. Is it common to simply ask the user to add some text to their `.bash_profile` or `.bashrc`?

Desired result
--------------

Should be able to install cleanly with brew and then run `foo` as a command:

```
$ brew install script
$ foo
# => does the interesting thing

```

(Assume the brew formula is already installed locally. I'll worry about auditing and pushing the formula to homebrew later)