216 Commits (trunk)

Author SHA1 Message Date
Thomas Riboulet 390c550034 remove unecessary parts
- remove postgresql and redis install
- install ruby 2.7.5 and 3.0.3 specifically
2 years ago
Chad Pytel a37310cc02
Use brew asdk, changes for latest node (#608)
Closes #563 
Closes #587
Closes #600

This makes the following changes:

* Installs asdf via Homebrew, thanks @jdbann in #592 and @gssbzn in #597
* The latest version of the asdf nodejs plugin takes care of the keyring stuff itself.
2 years ago
Chad Pytel 2584a6e453
Ignore shellcheck warning SC3043 globally (#606)
This warning states that "In POSIX sh, 'local' is undefined".

`local` is used extensively in the mac script, but it should be
understood by most OSes based on the information in:
https://stackoverflow.com/questions/18597697/posix-compliant-way-to-scope-variables-to-a-function-in-a-shell-script#answer-18600920

Add a line at the beginning of the script to ignore this warning
in the entire file to avoid false positives when linting locally.

Co-authored-by: rreinhardt9
2 years ago
Chad Pytel ef509a8c4e
Use gpg-suite-no-mail (#607)
Closes #575
Closes #531

Use an alternative gpg-suite package which does not install the mail extension.
2 years ago
Kamlesh 4df6f4639d Update ctags installation command (#586)
Closes https://github.com/thoughtbot/laptop/issues/584

The tap universal-ctags is not available anymore and these are the official instructions to install ctags.

Refer: https://github.com/universal-ctags/homebrew-universal-ctags
2 years ago
Chad Pytel 618d208e45
Use proper homebrew prefix and add to path (#602)
Closes #589 

This adds support for properly installing Homebrew on either Apple Silicon or Intel machines to the correct Homebrew location on macOS.

Also changes to:
* Using `HEAD` instead of `master`, which comes from the Homebrew home page.
* Use the new  `shellenv` recommended by Homebrew post-install next steps.
2 years ago
Daniel Colson c3d5a26bfa
Replace deprecated homebrew install command (#590)
The script we are currently using outputs a deprecation warning telling us to use this new bash script. See https://raw.githubusercontent.com/Homebrew/install/master/install

```
#!/usr/bin/ruby

STDERR.print <<EOS
Warning: The Ruby Homebrew installer is now deprecated and has been rewritten in
Bash. Please migrate to the following command:
  /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

EOS

Kernel.exec "/bin/bash", "-c", '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"'
```
3 years ago
Tyson Gach 57503d6131
Replace hub with GitHub CLI (#576)
GitHub has [announced GitHub CLI][announcement]. While hub was
semi-official, GitHub CLI is said to be GitHub’s new official CLI.

The backstory on hub and how GitHub CLI came to be can be read in the
post [‘The past and the future of hub’][hub-post] by Mislav Marohnić,
hub’s core maintainer.

[announcement]: https://github.blog/2020-02-12-supercharge-your-command-line-experience-github-cli-is-now-in-beta/
[hub-post]: https://mislav.net/2020/01/github-cli/
4 years ago
Rob Whittaker 8935bbcf77
Drop tapping of Homebrew cask
People used to have to tap Homebrew cask to use the `cask` command.
Homebrew have now integrated `cask` into the primary package manager.
`mac` was raising an error because the tap repository no longer exists.
We have dropped the tapping of `"homebrew/cask-cask"` from `mac`.
5 years ago
Jason Laxdal 85867e07e6 Update cask's tap location 5 years ago
David Knell 581e50e6a9 fix(laptop): remove redundant gem 5 years ago
Phill Sparks b7c85a7feb Update asdf plugins already installed (#554)
This may resolve some issues updating the languages, especially nodejs
where the asdf plugin maintains the signing keys required to verify the
package.

In order not to break anyone's laptop.local scripts, keep an alias of
`install_asdf_plugin` to the new method.
5 years ago
Nick Charlton 6a5e1e6719
Remove Qt.
Qt, a dependency on capybara-webkit, causes a lot of install problems
and most recently more so. We're not using capybara-webkit so much now,
so we don't absolutely need Qt.

Fixes #499.
6 years ago
jacob fecfd21d83 Standardize ellipses 6 years ago
jacob 5248e6a42a
Update brew heroku formula 6 years ago
jacob dc6884bac0
Add a tap for heroku
The Heroku install was not working for me until I made this change. 
Fresh install on OS X High Sierra.
6 years ago
Eebs Kobeissi 6a6dce197b Update asdf to 0.5.0
0.5.0 was released in May 2018. I've been using it for a while with no
issues.
6 years ago
Edward Loveall e33e510d6c
Shellcheck passes once again
It prefers new lines to be escaped `\\n` and to use `command -v`
instead of `which`.
6 years ago
Daniel Colson 938f1815da Only install released MRI versions of Ruby
Fixes #533 and may make #515 unnecessary.

When installing Ruby and Node, we use `asdf list-all` to find the
latest version. For Ruby, the list includes previews and release
candidates as well as non-MRI versions. The script failed for me because
it tried to install version `ree-1.8.7-2012.02`. Filtering out
versions with letters should ensure we only install fully released MRI
versions.
6 years ago
Kevin Solorio 8ad6fd7096 GPG Tools Renamed (#517)
Updated to gpg-suite
7 years ago
Derek Prior 2210951f07
Use ASDF version manager
At first, we did Ruby work, so we needed a ruby version manager.
Then we needed Node, so some of us added a node version manager.
Some of work with varying versions of Python, Elixir, Elm, etc.
ASDF lets us stop searching out solutions to the same problem in
each of these languges by supporting [plugins][1].

[1]: https://github.com/asdf-vm/asdf-plugins/tree/master/plugins
7 years ago
Hannah K @mindlessroman cfda02a041 Force update Homebrew
Add a force since there's sometimes a broken Homebrew update.
See https://github.com/Homebrew/brew/issues/1151

`brew update --force` will prevent stalling in the script.
Until the issue above is resolved,
it could pop up for someone trapped in a
'please update'-'already updated' loop.
7 years ago
Derek Prior cf590e324a
Skip install of Qt 5.5 if Xcode not installed
While trying to run laptop on a new machine, I got the following error:

> A full installation of Xcode.app is required to compile this software.
> Installing just the Command Line Tools is not sufficient.

To truly fix this, we'd need to script the installation of Xcode, which
is beyond my skills at the moment. For now, I use a conditional in the
generated `Brewfile` to skip if Xcode is not installed.
7 years ago
Dan Croak b00dd14c3b Configure CircleCI
* Move off Travis to Circle.
* Run the entire script on macOS infrastructure.
* Performance optimization:
  Enforce a Ruby version to skip Ruby install

We're cheating slightly with this implementation,
but seems worth it for speed of build tradeoff:

* Use pre-installed XCode for compilers, etc.
* Use pre-installed Ruby version.

Related:

https://github.com/thoughtbot/laptop/issues/494
7 years ago
Derek Prior b417be8522
Use universal-ctags
Universal ctags is a maintained and improved fork of
exuberant ctags. It adds many things, including better
ruby ctag support, and new supported languages.

https://github.com/universal-ctags/ctags
7 years ago
Derek Prior 3ffa16e6ed
Restart services only when necessary
The Brewfile supports restarting the service only when there's a change
to that service. See [docs][1].

[1]: https://github.com/Homebrew/homebrew-bundle#restarting-services
7 years ago
Dan Croak 0636eea198 Update heroku binary symlink in PATH
For users running the Laptop script
who once had `heroku-toolbelt` installed,
it's possible their `PATH` may be out of date.

Use a similar pattern for updating the link to the `heroku` binary
as we used when migrating `qmake` for `qt5.5` from `qt`.

Also, update documentation.

Related: 3b7845b849
7 years ago
Derek Prior 3b7845b849
Install Heroku CLI instead of toolbelt
Heroku Toolbelt has been replaced, or perhaps just renamed to, Heroku
CLI. It is installed with `brew install heroku`. See:
https://devcenter.heroku.com/articles/heroku-cli#macos
7 years ago
Dan Croak ea7db9be3b Add Watchman for watching filesystem changes
https://facebook.github.io/watchman/

> Watchman is a tool by Facebook for watching changes in the filesystem.
> It is highly recommended you install it for better performance.

https://facebook.github.io/react-native/docs/getting-started.html
7 years ago
Dan Croak 5817a120c3 Use Homebrew path for zsh conditional
* We install zsh via Homebrew in the Laptop script.
* Checking for a different path via `which zsh`
  caused the user to have to type their password every script run
  to allow for `chsh` to run.
7 years ago
Dan Croak 4f96d474e5 Install Yarn
* Rails ships with Yarn.
  https://twitter.com/dhh/status/808348184481124352?lang=en
* We use Yarn in some of our project templates.
  https://github.com/thoughtbot/react-native-template/blob/master/TemplateProject/bin/setup
7 years ago
Dan Croak aa4420650d Fix and improve shellcheck setup for TravisCI
Based on:

https://github.com/koalaman/shellcheck/wiki/TravisCI

Exclude SC2039

https://github.com/thoughtbot/laptop/issues/481
7 years ago
Dan Croak a11e4a509d Install Qt 5 instead of Qt 4
We install Qt because it is a dependency of Capybara Webkit.

> Qt 4 is several years old and contains a version of WebKit with many
> serious defects. Support for Qt 4 will be dropped in any future
> feature releases and is not supported by the capybara-webkit team.

https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit
7 years ago
Björn Andersson 401107bcdd Set login shell to brew's zsh when available
Optimize for speed:

https://youtu.be/ZwNWviK5z0Q?t=9
7 years ago
Björn Andersson fc38941d4c Add zsh path to /etc/shells
From the chsh documentation:

  When altering a login shell, and not the super-user, the user
  may not change from a non-standard shell or to a non-standard shell.
  Non-standard is defined as a shell not found in /etc/shells.
7 years ago
Dan Croak 0b440c5138 Use `brew bundle` instead of custom functions 8 years ago
Dan Croak 425e3bc545 Fix `brew tap thoughtbot/formulae`
https://github.com/thoughtbot/laptop/issues/437
https://github.com/thoughtbot/laptop/issues/448
8 years ago
Dan Croak 66f16d8690 Improve readability of permissions code
* Better reveal intent with `HOMEBREW_PREFIX` variable.
* Do less work by referencing `$USER` instead of `whoami`.

https://github.com/thoughtbot/laptop/issues/444

The $USER environment variable is not guaranteed to exist,
but $LOGNAME is defined by POSIX
(Environment Variables, section 8.3 Other Environment Variables).

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03
http://unix.stackexchange.com/questions/76354/who-sets-user-and-username-environment-variables
8 years ago
Dan Croak c8dca7705b Don't link OpenSSL
From @mikemcquaid:

> On 10.11 the OpenSSL headers are removed but library remains. Given
> Clang's default paths this means things will use the Homebrew headers
> but link against the system libraries. At best, it's insecure. At
> worst, it'll cause random, hard-to-debug runtime failures.

https://github.com/thoughtbot/laptop/pull/403/files#r41858641
https://github.com/thoughtbot/laptop/issues/401#issuecomment-114518831
8 years ago
Dan Croak and Gabe Berke-Williams 0bcc0b4644 Revert "Clean up old Homebrew formulas after run"
This reverts commit ef7408d6a1.

* `brew cleanup` removes Postgres.
* Migrating data in Postgres from old to new versions relies on
  the previous version of Postgres to run `pg_upgrade`.
* Laptop shouldn't lose users' Postgres data.
* Those who don't mind starting their new Postgres databases
  from scratch can `brew cleanup` in `~/.laptop.local`.
8 years ago
Dan Croak and Gabe Berke-Williams 458f43e85b chown -R `whoami`:admin /usr/local if necessary
We link to this in the docs:

https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/El_Capitan_and_Homebrew.md

We can safely automate this to provide a better experience.
8 years ago
Dan Croak 7afe1652fd Check for dead symlinks, relink valid formulae
Use the [`--repair`] flag to check for dead symlinks
and relink all valid formulae across taps.

[`--repair`]: https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/brew-tap.md
8 years ago
Dan Croak 942ad3be89 Group related lines together by printed headers
Sections:

* "Installing Homebrew packages ..."
* "Restarting services ..."
* "Relinking OpenSSL ..."
* "Configuring Ruby ..."
* "Running your customizations from ~/.laptop.local ..."
* "Cleaning up old Homebrew formulas ..."

Related:

* To make that work in the desired way,
  print less noise in the custom functions.
* We don't need parity as customization in README.
* Match documentation to sections, move OpenSSL to Unix section.
* Move libyaml to after OpenSSL, before Ruby.
8 years ago
Al Johri 5d63acef2e Fix brew_expand_alias for non-standard packages
For example:

```
brew info brew-cask 2>/dev/null | head -1 | awk '{gsub(/:/, ""); print $1}'
caskroom/cask/brew-cask

brew info brew-cask 2>/dev/null | head -1 | awk '{gsub(/.*\//, ""); gsub(/:/, ""); print $1}'
brew-cask
```

`brew list -1` only has the shorter name listed
so it will try to re-install packages that are already installed.
8 years ago
Dan Croak d061842e25 Install Parity
* The Parity Homebrew [package] installs Heroku Toolbelt, Git, Postgres
  but it seems nice for documentation purposes to
  keep the Homebrew packages installed for the other dependencies.
* Tap the Homebrew formula first, so it updates with `brew update`.

[package]: https://github.com/thoughtbot/homebrew-formulae/blob/master/Formula/parity.rb
8 years ago
Dan Croak ef7408d6a1 Clean up old Homebrew formulas after run
This can save significant disk space.
Upon running this, I regularly see close to 1GB of space freed up.
8 years ago
Dan Croak c92c7adc7f Migrate to built-in Homebrew-Cask
> Homebrew-Cask will now be kept up to date together with Homebrew

> If you haven’t yet,
> run `brew uninstall --force brew-cask; brew update`
> to switch to the new system.

e83c0099aa

> To start using Homebrew-Cask, you just need Homebrew installed.

0d290b15e8
8 years ago
Dan Croak 2c655fca56 Match rbenv init line to thoughtbot/dotfiles
`append_to_zshrc` checks whether the substring is in
`~/.zshrc` or `~/.zshrc.local`.
If it isn't, it appends it.

https://github.com/thoughtbot/dotfiles/blob/master/zsh/configs/post/path.zsh
8 years ago
Dan Croak 36cd104021 Use rbenv for latest Ruby version, not S3 file 8 years ago
Dan Croak 847b244969 Install shellcheck differently for Travis
https://docs.travis-ci.com/user/installing-dependencies/#Installing-Packages-without-an-APT-Repository
8 years ago