[
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "content": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Describe the issue**\nA clear and concise description of what the problem is.\n\n**Log**\nIf applicable, please either attach or include the log from the\nrun of the script that had the problem.\n\n**Please complete the following information:**\n - macOS Version: [e.g. 13.0.1]\n - Fresh install? [Yes/No]\n\n**Additional context**\nAdd any other context about the problem here.\nIf the problem beieng reported is not on a fresh macOS install,\nplease describe what else is already installed.\n"
  },
  {
    "path": ".github/pull_request_template.md",
    "content": "A description of your change.\n\n- [ ] Updated CHANGELOG\n- [ ] Updated README.md (if necessary)\n"
  },
  {
    "path": ".github/workflows/dynamic-readme.yml",
    "content": "name: update-templates\n\non: \n  push:\n    branches:\n      - main\n  workflow_dispatch:\n\njobs:\n  update-templates:\n    permissions:\n      contents: write\n      pull-requests: write\n      pages: write\n    uses: thoughtbot/templates/.github/workflows/dynamic-readme.yaml@main\n    secrets:\n      token: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/dynamic-security.yml",
    "content": "name: update-security\n\non:\n  push:\n    paths:\n      - SECURITY.md\n    branches:\n      - main\n  workflow_dispatch:\n\njobs:\n  update-security:\n    permissions:\n      contents: write\n      pull-requests: write\n      pages: write\n    uses: thoughtbot/templates/.github/workflows/dynamic-security.yaml@main\n    secrets:\n      token: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".gitignore",
    "content": "*.swp\nartifacts\n"
  },
  {
    "path": "CHANGELOG",
    "content": "# Changelog\n\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).\n\n## [Unreleased]\n\n## 2025-07-09\n\n* Removed deprecated homebrew/services tap\n\n## 2025-06-25\n\n* asdf is now updated if it is already installed and asdf commands were updated\n  to work with latest versions.\n\n## 2024-09-24\n\n* Support for macOS Sequoia\n\n## 2023-10-03\n\n### Added\n\n* Support for macOS Sonoma\n\n## 2022-12-02\n\n### Added\n\n* Support for macOS Ventura\n\n### Fixed\n\n* [The warning or failure when installing universal-ctags](https://github.com/thoughtbot/laptop/pull/623)\n* [The PostgreSQL Homebrew definition has been fixed](https://github.com/thoughtbot/laptop/pull/612)\n* [Return error code for failure sourcing asdf.sh](https://github.com/thoughtbot/laptop/pull/620)\n* [Fix for location change of asdf.sh](https://github.com/thoughtbot/laptop/pull/622)\n\n## 2022-03-30\n\n### Changed\n\n* Official support for macOS Monterey on Apple Silicon and Intel and removes official support for prior versions of macOS.\n* [Use brew asdk, changes for latest node](https://github.com/thoughtbot/laptop/pull/608)\n* [Ignore shellcheck warning SC3043 globally](https://github.com/thoughtbot/laptop/pull/606)\n* [Use gpg-suite-no-mail](https://github.com/thoughtbot/laptop/pull/607)\n* [Update ctags installation command](https://github.com/thoughtbot/laptop/pull/586)\n\n## 2023-04-24\n\n### Changed\n\n* [Adds Rosetta 2 in case a macbook has M1 architecture](https://github.com/thoughtbot/laptop/pull/628)\n"
  },
  {
    "path": "CODEOWNERS",
    "content": "# Lines starting with '#' are comments.\n# Each line is a file pattern followed by one or more owners.\n\n# More details are here: https://help.github.com/articles/about-codeowners/\n\n# The '*' pattern is global owners.\n\n# Order is important. The last matching pattern has the most precedence.\n# The folders are ordered as follows:\n\n# In each subsection folders are ordered first by depth, then alphabetically.\n# This should make it easy to add new rules without breaking existing ones.\n\n# Global rule:\n*           @cpytel\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright (c) 2011-2025 thoughtbot, inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "Laptop\n======\n\nLaptop is a script to set up a macOS laptop for web and mobile development.\n\nIt can be run multiple times on the same machine safely.\nIt installs, upgrades, or skips packages\nbased on what is already installed on the machine.\n\nRequirements\n------------\n\nWe support:\n\n* macOS Sequoia (15.x) on Apple Silicon and Intel\n* macOS Sonoma (14.x) on Apple Silicon and Intel\n* macOS Ventura (13.x) on Apple Silicon and Intel\n* macOS Monterey (12.x) on Apple Silicon and Intel\n\nOlder versions may work but aren't regularly tested.\nBug reports for older versions are welcome.\n\nInstall\n-------\n\nDownload the script:\n\n```sh\ncurl --remote-name https://raw.githubusercontent.com/thoughtbot/laptop/main/mac\n```\n\nReview the script (avoid running scripts you haven't read!):\n\n```sh\nless mac\n```\n\nExecute the downloaded script:\n\n```sh\nsh mac 2>&1 | tee ~/laptop.log\n```\n\nOptionally, review the log:\n\n```sh\nless ~/laptop.log\n```\n\nOptionally, [install thoughtbot/dotfiles][dotfiles].\n\n[dotfiles]: https://github.com/thoughtbot/dotfiles#install\n\nDebugging\n---------\n\nYour last Laptop run will be saved to `~/laptop.log`.\nRead through it to see if you can debug the issue yourself.\nIf not, copy the lines where the script failed into a\n[new GitHub Issue](https://github.com/thoughtbot/laptop/issues/new) for us.\nOr, attach the whole log file as an attachment.\n\nWhat it sets up\n---------------\n\nmacOS tools:\n\n* [Homebrew] for managing operating system libraries.\n\n[Homebrew]: http://brew.sh/\n\nUnix tools:\n\n* [fzf][] for better command history searching\n* [Universal Ctags] for indexing files for vim tab completion\n* [Git] for version control\n* [OpenSSL] for Transport Layer Security (TLS)\n* [RCM] for managing company and personal dotfiles\n* [The Silver Searcher] for finding things in files\n* [Tmux] for saving project state and switching between projects\n* [Watchman] for watching for filesystem events\n* [Zsh] as your shell\n\n[fzf]: https://github.com/junegunn/fzf\n[Universal Ctags]: https://ctags.io/\n[Git]: https://git-scm.com/\n[OpenSSL]: https://www.openssl.org/\n[RCM]: https://github.com/thoughtbot/rcm\n[The Silver Searcher]: https://github.com/ggreer/the_silver_searcher\n[Tmux]: http://tmux.github.io/\n[Watchman]: https://facebook.github.io/watchman/\n[Zsh]: http://www.zsh.org/\n\nHeroku tools:\n\n* [Heroku CLI] and [Parity] for interacting with the Heroku API\n\n[Heroku CLI]: https://devcenter.heroku.com/articles/heroku-cli\n[Parity]: https://github.com/thoughtbot/parity\n\nGitHub tools:\n\n* [GitHub CLI] for interacting with the GitHub API\n\n[GitHub CLI]: https://cli.github.com/\n\nImage tools:\n\n* [ImageMagick] for cropping and resizing images\n\nProgramming languages, package managers, and configuration:\n\n* [asdf-vm] for managing programming language versions\n* [Bundler] for managing Ruby libraries\n* [Node.js] and [npm], for running apps and installing JavaScript packages\n* [Ruby] stable for writing general-purpose code\n* [Yarn] for managing JavaScript packages\n* [Rosetta 2] for running tools that are not supported in Apple silicon processors\n\n[Bundler]: http://bundler.io/\n[ImageMagick]: http://www.imagemagick.org/\n[Node.js]: http://nodejs.org/\n[npm]: https://www.npmjs.org/\n[asdf-vm]: https://github.com/asdf-vm/asdf\n[Ruby]: https://www.ruby-lang.org/en/\n[Yarn]: https://yarnpkg.com/en/\n[Rosetta 2]: https://developer.apple.com/documentation/apple-silicon/about-the-rosetta-translation-environment\n\nDatabases:\n\n* [Postgres] for storing relational data\n* [Redis] for storing key-value data\n\n[Postgres]: http://www.postgresql.org/\n[Redis]: http://redis.io/\n\nIt should take less than 15 minutes to install (depends on your machine).\n\nCustomize in `~/.laptop.local`\n------------------------------\n\nYour `~/.laptop.local` is run at the end of the Laptop script.\nPut your customizations there.\nFor example:\n\n```sh\n#!/bin/sh\n\nbrew bundle --file=- <<EOF\nbrew \"Caskroom/cask/dockertoolbox\"\nbrew \"go\"\nbrew \"ngrok\"\nbrew \"watch\"\nEOF\n\ndefault_docker_machine() {\n  docker-machine ls | grep -Fq \"default\"\n}\n\nif ! default_docker_machine; then\n  docker-machine create --driver virtualbox default\nfi\n\ndefault_docker_machine_running() {\n  default_docker_machine | grep -Fq \"Running\"\n}\n\nif ! default_docker_machine_running; then\n  docker-machine start default\nfi\n\nfancy_echo \"Cleaning up old Homebrew formulae ...\"\nbrew cleanup\n\nif [ -r \"$HOME/.rcrc\" ]; then\n  fancy_echo \"Updating dotfiles ...\"\n  rcup\nfi\n```\n\nWrite your customizations such that they can be run safely more than once.\nSee the `mac` script for examples.\n\nLaptop functions such as `fancy_echo` and\n`gem_install_or_update`\ncan be used in your `~/.laptop.local`.\n\nSee the [wiki](https://github.com/thoughtbot/laptop/wiki)\nfor more customization examples.\n\nContributing\n------------\n\nThank you, [contributors]!\n\n[contributors]: https://github.com/thoughtbot/laptop/graphs/contributors\n\nBy participating in this project,\nyou agree to abide by the thoughtbot [code of conduct].\n\n[code of conduct]: https://thoughtbot.com/open-source-code-of-conduct\n\nEdit the `mac` file.\nDocument in the `README.md` file.\nUpdate the `CHANGELOG`.\nFollow shell style guidelines by using [ShellCheck] and [ALE] or deprecated [Syntastic].\n\n```sh\nbrew install shellcheck\n```\n\n[ShellCheck]: http://www.shellcheck.net/about.html\n[Syntastic]: https://github.com/scrooloose/syntastic\n[ALE]: https://github.com/dense-analysis/ale\n\n\n### Testing your changes\n\nTest your changes by running the script on a fresh install of macOS.\nYou can use the free and open source emulator [UTM].\n\nTip: Make a fresh virtual machine with the installation of macOS completed and\nyour user created and first launch complete. Then duplicate that machine to test\nthe script each time on a fresh install that's ready to go.\n\n[UTM]: https://mac.getutm.app\n\nLicense\n-------\n\nCopyright © 2011 thoughtbot, inc.\nIt is free software,\nand may be redistributed under the terms specified in the [LICENSE] file.\n\n[LICENSE]: LICENSE\n\n<!-- START /templates/footer.md -->\n## About thoughtbot\n\n![thoughtbot](https://thoughtbot.com/thoughtbot-logo-for-readmes.svg)\n\nThis repo is maintained and funded by thoughtbot, inc.\nThe names and logos for thoughtbot are trademarks of thoughtbot, inc.\n\nWe love open source software!\nSee [our other projects][community].\nWe are [available for hire][hire].\n\n[community]: https://thoughtbot.com/community?utm_source=github\n[hire]: https://thoughtbot.com/hire-us?utm_source=github\n\n<!-- END /templates/footer.md -->\n"
  },
  {
    "path": "SECURITY.md",
    "content": "<!-- START /templates/security.md -->\n# Security Policy\n\n## Supported Versions\n\nOnly the the latest version of this project is supported at a given time. If\nyou find a security issue with an older version, please try updating to the\nlatest version first.\n\nIf for some reason you can't update to the latest version, please let us know\nyour reasons so that we can have a better understanding of your situation.\n\n## Reporting a Vulnerability\n\nFor security inquiries or vulnerability reports, visit\n<https://thoughtbot.com/security>.\n\nIf you have any suggestions to improve this policy, visit <https://thoughtbot.com/security>.\n\n<!-- END /templates/security.md -->\n"
  },
  {
    "path": "mac",
    "content": "#!/bin/sh\n\n# Welcome to the thoughtbot laptop script!\n# Be prepared to turn your laptop (or desktop, no haters here)\n# into an awesome development machine.\n\n# shellcheck disable=SC3043\n\nfancy_echo() {\n  local fmt=\"$1\"; shift\n\n  # shellcheck disable=SC2059\n  printf \"\\\\n$fmt\\\\n\" \"$@\"\n}\n\nappend_to_zshrc() {\n  local text=\"$1\" zshrc\n  local skip_new_line=\"${2:-0}\"\n\n  if [ -w \"$HOME/.zshrc.local\" ]; then\n    zshrc=\"$HOME/.zshrc.local\"\n  else\n    zshrc=\"$HOME/.zshrc\"\n  fi\n\n  if ! grep -Fqs \"$text\" \"$zshrc\"; then\n    if [ \"$skip_new_line\" -eq 1 ]; then\n      printf \"%s\\\\n\" \"$text\" >> \"$zshrc\"\n    else\n      printf \"\\\\n%s\\\\n\" \"$text\" >> \"$zshrc\"\n    fi\n  fi\n}\n\n# shellcheck disable=SC2154\ntrap 'ret=$?; test $ret -ne 0 && printf \"failed\\n\\n\" >&2; exit $ret' EXIT\n\nset -e\n\nif [ ! -d \"$HOME/.bin/\" ]; then\n  mkdir \"$HOME/.bin\"\nfi\n\nif [ ! -f \"$HOME/.zshrc\" ]; then\n  touch \"$HOME/.zshrc\"\nfi\n\n# shellcheck disable=SC2016\nappend_to_zshrc 'export PATH=\"$HOME/.bin:$PATH\"'\n\n# Determine Homebrew prefix\narch=\"$(uname -m)\"\nif [ \"$arch\" = \"arm64\" ]; then\n  HOMEBREW_PREFIX=\"/opt/homebrew\"\nelse\n  HOMEBREW_PREFIX=\"/usr/local\"\nfi\n\nupdate_shell() {\n  local shell_path;\n  shell_path=\"$(command -v zsh)\"\n\n  fancy_echo \"Changing your shell to zsh ...\"\n  if ! grep \"$shell_path\" /etc/shells > /dev/null 2>&1 ; then\n    fancy_echo \"Adding '$shell_path' to /etc/shells\"\n    sudo sh -c \"echo $shell_path >> /etc/shells\"\n  fi\n  sudo chsh -s \"$shell_path\" \"$USER\"\n}\n\ncase \"$SHELL\" in\n  */zsh)\n    if [ \"$(command -v zsh)\" != \"$HOMEBREW_PREFIX/bin/zsh\" ] ; then\n      update_shell\n    fi\n    ;;\n  *)\n    update_shell\n    ;;\nesac\n\n# checks architecture\nif [ \"$(uname -m)\" = \"arm64\" ]\n  then\n  # checks if Rosetta is already installed\n  if ! pkgutil --pkg-info=com.apple.pkg.RosettaUpdateAuto > /dev/null 2>&1\n  then\n    echo \"Installing Rosetta\"\n    # Installs Rosetta2\n    softwareupdate --install-rosetta --agree-to-license\n  else\n    echo \"Rosetta is installed\"\n  fi\nfi\n\n\ngem_install_or_update() {\n  if gem list \"$1\" --installed > /dev/null; then\n    gem update \"$@\"\n  else\n    gem install \"$@\"\n  fi\n}\n\nif ! command -v brew >/dev/null; then\n  fancy_echo \"Installing Homebrew ...\"\n    /bin/bash -c \\\n      \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"\n\n    append_to_zshrc \"eval \\\"\\$($HOMEBREW_PREFIX/bin/brew shellenv)\\\"\"\n\n    export PATH=\"$HOMEBREW_PREFIX/bin:$PATH\"\nfi\n\nif brew list | grep -Fq brew-cask; then\n  fancy_echo \"Uninstalling old Homebrew-Cask ...\"\n  brew uninstall --force brew-cask\nfi\n\nfancy_echo \"Updating Homebrew formulae ...\"\nbrew update --force # https://github.com/Homebrew/brew/issues/1151\nbrew bundle --file=- <<EOF\ntap \"thoughtbot/formulae\"\ntap \"heroku/brew\"\n\n# Unix\nbrew \"universal-ctags\"\nbrew \"fzf\"\nbrew \"git\"\nbrew \"openssl\"\nbrew \"rcm\"\nbrew \"reattach-to-user-namespace\"\nbrew \"the_silver_searcher\"\nbrew \"tmux\"\nbrew \"vim\"\nbrew \"watchman\"\nbrew \"zsh\"\n\n# Heroku\nbrew \"heroku/brew/heroku\"\nbrew \"parity\"\n\n# GitHub\nbrew \"gh\"\n\n# Image manipulation\nbrew \"imagemagick\"\n\n# PDF Rendering\nbrew \"poppler\"\n\n# Programming language prerequisites and package managers\nbrew \"libyaml\" # should come after openssl\nbrew \"coreutils\"\nbrew \"yarn\"\ncask \"gpg-suite-no-mail\"\n\n# Databases\nbrew \"postgresql@14\", restart_service: :changed\nbrew \"redis\", restart_service: :changed\nEOF\n\nfancy_echo \"Update heroku binary ...\"\nbrew unlink heroku\nbrew link --force heroku\n\nfancy_echo \"Configuring asdf version manager ...\"\nif [ ! -d \"$HOME/.asdf\" ]; then\n  brew install asdf\n  append_to_zshrc \"source $(brew --prefix asdf)/libexec/asdf.sh\" 1\nelse\n  brew upgrade asdf\nfi\n\nalias install_asdf_plugin=add_or_update_asdf_plugin\nadd_or_update_asdf_plugin() {\n  local name=\"$1\"\n  local url=\"$2\"\n\n  if ! asdf plugin list | grep -Fq \"$name\"; then\n    asdf plugin add \"$name\" \"$url\"\n  else\n    asdf plugin update \"$name\"\n  fi\n}\n\n# shellcheck disable=SC1091\n. \"$(brew --prefix asdf)/libexec/asdf.sh\"\nadd_or_update_asdf_plugin \"ruby\" \"https://github.com/asdf-vm/asdf-ruby.git\"\nadd_or_update_asdf_plugin \"nodejs\" \"https://github.com/asdf-vm/asdf-nodejs.git\"\n\ninstall_asdf_language() {\n  local language=\"$1\"\n  local version\n  version=\"$(asdf list all \"$language\" | grep -v \"[a-z]\" | tr -s '\\n' | tail -1)\"\n\n  if ! asdf list \"$language\" | grep -Fq \"$version\"; then\n    asdf install \"$language\" \"$version\"\n    asdf set --home \"$language\" \"$version\"\n  fi\n}\n\nfancy_echo \"Installing latest Ruby ...\"\ninstall_asdf_language \"ruby\"\ngem update --system\nnumber_of_cores=$(sysctl -n hw.ncpu)\nbundle config --global jobs $((number_of_cores - 1))\n\nfancy_echo \"Installing latest Node ...\"\ninstall_asdf_language \"nodejs\"\n\nif [ -f \"$HOME/.laptop.local\" ]; then\n  fancy_echo \"Running your customizations from ~/.laptop.local ...\"\n  # shellcheck disable=SC1091\n  . \"$HOME/.laptop.local\"\nfi\n"
  }
]