This prevents the ugly "Warning" messages
which Homebrew outputs by default
when tapping something that is already tapped.
Sourcing this script in my personal set up,
I use it as thus:
brew_tap 'homebrew/dupes'
brew_tap 'homebrew/versions'
brew_tap 'homebrew/boneyard'
brew_tap 'homebrew/science'
brew_tap 'homebrew/php'
brew_tap 'caskroom/cask'
brew_tap 'caskroom/versions'
brew_tap 'caskroom/fonts'
brew_tap 'thoughtbot/formulae'
From @derekprior:
> I never used NVM. I just kept my homebrew installed version pinned to
> the version we were using. As a company this is probably totally fine
> because we don't jump back and forth between node projects like we do
> with Ruby projects. Also, there is no "system" node to worry about.
https://github.com/thoughtbot/laptop/pull/341#issuecomment-66179326
Disable false-positives via shellcheck declarations:
- L10: We're passing a format string as argument
- L44, etc: We want the expressions to be appended literally
- Remove glob within test command
- Replace [[ bashism with POSIX [
- Replace source bashism with POSIX .
- Replace (( bashism with POSIX [
- Remove process substitution bashism
Other fixes:
- Simplify return value negation
- Use grep -F for speedup on non-regex
- Use $HOME consistently over ~
* Say whether we are Installing, Upgrading, or Skipping.
* Changes the behavior of `brew_install_or_upgrade`
but simplifies and shortens the rest of the script.
Laptop should be responsible for setting up
the compilers,
system package manager,
programming language version managers & installers,
large system dependencies such as Postgres,
and any critical config for those tools
which is often overlooked but can cause bugs and headaches.
Other useful command-line tools such as `watch` and `tree`
are better installed in individuals' `~/.laptop.local` files.
Add `tree` as a good example for that file.
Try to make `~/.laptop.local` explanation clearer
and more prominent by placing it in a heading.
Remove Suspenders as an example.
Right before using Suspenders,
it's probably best to re-install it to get the latest.
* These are great tools, but not critical.
* Some tools should be re-installed right before their use,
such as Suspenders.
* Restrict Laptop to more fundamental setup.
* Document how to install these in `~/.laptop.local`.
While we did previously state "Read, then...", that's easier to ignore.
This brings the copy-pastable commands in line with the intent: to have
the user review the script before executing it. This also removes the
potentially confusing use of process substitution.
Note: The presence of `less` is assumed to avoid assumptions about
editors or the noise of handling that robustly (e.g. `${EDITOR:-vim}`)
* Many thoughtbot employees are successfully using Homebrew'd rbenv.
* rbenv's recommended install is Homebrew for OS X:
https://github.com/rbenv/rbenv#installation
* We use Homebrew / package management whenever possible for
system dependencies.
* We save a step adding rbenv to `PATH` in zshrc / zshenv,
because Homebrew does it for us.
This is nice because we don't add `rbenv` to `PATH` in
thoughtbot/dotfiles.
I haven't been using `heroku config:pull`, etc. for some time.
Instead, I've been using more targeted shell lines insides our
[`bin/setup`] convention, such as:
if ! grep -F "FILEPICKER" .env > /dev/null; then
heroku config --remote staging | grep "FILEPICKER" >> .env
sed -i '' 's/\:/=/' .env
sed -i '' 's/ //g' .env
fi
[`bin/setup`]: http://robots.thoughtbot.com/bin-setup
This is more targeted and automated than using `heroku config:pull`.
Many corporate firewalls block the git:// protocol.
Changing this URI to use https:// makes it usable for more people.
The other Git URIs are all using https://.
This was previously the only exception.
Relies on `append_to_zshrc` to add a new line after the appended text.
`append_to_zshrc()` will accept a second argument (`boolean`) to skip the new
line before the appended text, by default a new line will always be prepended.
Upstream maintainers put thought into what is
and what isn't sensible to include by default.
Those decisions establish a de facto standard
that is broader in scope than Laptop:
Homebrew users, library users, etc.
The further we stray from the defaults,
the more likely we are to run into problems,
and those problems will be harder.
The most widely experienced, most urgent,
and most rapidly fixed problems will be
problems with installing using formula defaults.
Problems from using non-defaults are relatively lonely.
Also, Homebrew bottles are awesome:
https://github.com/Homebrew/homebrew/wiki/FAQ#why-do-you-compile-everything
Using options forces an install from source rather than a bottle,
which is much, much slower:
> Options were passed to the install command i.e. `brew install
> $FORMULA` will use a bottled version of `$FORMULA`, but `brew install
> $FORMULA --enable-bar` will trigger a source build.
Commit bc5a7c6 changed how rbenv is installed
("Use the same Git/GitHub approach for Mac as we do for Linux."),
but was missing the changes in the manifest files.
This commit fixes the corresponding manifest files.
* Use the same Git/GitHub approach for Mac as we do for Linux.
* This makes upgrading easier via `git pull`.
* Add idempotency `if` guards.
* Use bash-preferred bracket-bracket style.
http://robots.thoughtbot.com/the-unix-shells-humble-if
`&>` redirects both `stderr` and `stdout`.
`>` redirects only stdout.
Use `&>` when we explicitly want to ignore/discard error messages,
which is rarely.
`command -v` outputs only stdout.
So, `>` is appropriate because there is expected `stderr` output.
In the rare case that command fails,
we want the reason printed.