/formation

💻 macOS setup script for front-end development

Primary LanguageShellMIT LicenseMIT

FoRmation

FoRmation is a shell script to set up a macOS laptop for design, development, and R. It is entirely based on Mina Markham's excellent Formation. It can be run multiple times on the same machine safely. It installs, upgrades, or skips packages based on what is already installed on the machine.

Install

Download the script:

git clone git@github.com/ajaypillarisetti/formation.git && cd formation

Review the script (please don't run scripts you don't understand):

less slay

Slay:

cd formation
./slay 2>&1 | tee ~/slay.log

Just follow the prompts and you’ll be fine.

⚠️ Warning: I advise against running this script unless you understand what it’s doing to your computer.

Mina created this based on her own preferences; I updated it to include things I need for work, including R, Creative Cloud, and other stuff. Your mileage will vary.

Once the script is done, quit and relaunch Terminal.

It is highly recommended to run the script regularly to keep your computer up to date.

Your last FoRmation run will be saved to ~/slay.log. To review it, run less ~/slay.log.

What it sets up

The setup process will install:

Basic tools:
CLI Tools & Utilities:
  • Hub for interacting with the GitHub API
  • mas Mac App Store command line interface
  • pandoc
  • Tig text-mode interface for git

Apps

Productivity
Development
Design
Communication
  • Skype for free calls to friends and family.
  • Slack where work happens.
  • Zoom
Utilities
Miscellaneous * [Beamer](https://beamer-app.com) for sending video from your mac to other screens. * [Handbrake](https://handbrake.fr) for encoding video. * [Kindle](https://apps.apple.com/us/app/kindle/id405399194?mt=12) * [NetNewsWire](https://ranchero.com/netnewswire/) the once and future king of RSS readers. * [Plex Media Player](https://www.plex.tv/blog/introducing-the-plex-media-player/) for accessing remove media libraries. * [VLC](http://www.videolan.org/) for a better media player.
Browsers
  • Brave for web browsing without ads.
  • Chrome for fast and free web browsing.
R Packages
  • assertthat
  • data.table
  • dbplyr
  • doMC
  • dplyr
  • DT
  • dygraphs
  • ggplot2
  • httr
  • knitr
  • lubridate
  • magrittr
  • nlme
  • plyr
  • purrr
  • readxl
  • reshape2
  • rsconnect
  • shiny
  • shiny.semantic
  • shinydashboard
  • shinyjs
  • stringr
  • testthat
  • tidyr
  • tint
  • tufte
  • writexl
  • zoo

Also installed all of the package dependencies. Currently writtent to support only packages on CRAN.

🌶 Just add ~/.hot-sauce

Your ~/.hot-sauce is added at the end of the FoRmation script. Put your customizations there. For example:

#!/usr/bin/env bash

NERDFONTS_RELEASE=$(curl -L -s -H 'Accept: application/json' https://github.com/ryanoasis/nerd-fonts/releases/latest)
NERDFONTS_VERSION=$(get_github_version $NERDFONTS_RELEASE)

NERDFONTS=(
    SpaceMono
    Hack
    AnonymousPro
    SourceCodePro
    Inconsolata
)

step "Installing fonts…"
for font in ${NERDFONTS[@]}; do
    if [ ! -d ~/Library/Fonts/$font ]; then
        printf "${indent}  [↓] $font "
        wget -P ~/Library/Fonts https://github.com/ryanoasis/nerd-fonts/releases/download/$NERDFONTS_VERSION/$font.zip --quiet;unzip -q ~/Library/Fonts/$font -d ~/Library/Fonts/$font
        print_in_green "${bold}✓ done!${normal}\n"
    else
        print_muted "${indent}$font already installed. Skipped."
    fi
done

step "Installing R Packages"
for package in $(<$cwd/swag/rpackages); do
    if [ ! -d /Library/Frameworks/R.framework/Versions/Current/Resources/library/$package ]; then
        printf "${indent}  [↓] $package "
        Rscript ~/Documents/formation-pillarisetti/swag/install_packages.R $package
        print_in_green "${bold}✓ done!${normal}\n"
    else
        print_muted "${indent}$package already installed. Skipped."
    fi
done

Write your customizations such that they can be run safely more than once.

FoRmation functions such as step and link can be used in your ~/.hot-sauce.

Known Issues

Cask does not recognize applications installed outside of Homebrew Cask – in the case that the script fails, you can either remove the application from the install list or uninstall the application causing the failure and try again.

Acknowledgements

Inspiration and code was taken from many sources, including:

📜 License

Formation is customized for my own needs. It is free software, and may be redistributed under the terms specified in the LICENSE file.