Skip to content

Instantly share code, notes, and snippets.

@packetpilot
Last active September 20, 2017 18:57
Show Gist options
  • Save packetpilot/f6630f763120390aafad2c5392de7d1a to your computer and use it in GitHub Desktop.
Save packetpilot/f6630f763120390aafad2c5392de7d1a to your computer and use it in GitHub Desktop.
Patch iTerm2 via luggage-based pkg, or with just the postinstall
# iTerm: a simple payload-free iTerm installer
#
# Author: @packetpilot
# Created: 2017-09-19
# Last Modified: 2017-09-19
#
include /usr/local/share/luggage/luggage.make
TITLE=iTerm
REVERSE_DOMAIN=com.example.corp
PAYLOAD= \
pack-script-postinstall
#!/bin/bash
# This script doesn't _seem_ polite, but it's been tested with an old 3.0.4
# version running while 3.1.1 updates right behind it. Logs continued to tail
# just fine. So, while it might be optimal for login/logout hook, or at
# loginwindow, it also seems to non-disruptively do the job on-the-fly.
# Variables
EXTURL=https://iterm2.com/downloads/stable/latest
TMPDIR=${3}/tmp/iterm
ZIPLOC=${TMPDIR}/iTerm.zip
mkdir ${TMPDIR}
curl -L -o \
${ZIPLOC} ${EXTURL}
unzip -o ${ZIPLOC} -d ${3}/Applications
rm -rf ${TMPDIR}
@packetpilot
Copy link
Author

If the postinstall script is used in a non-installer-based context, you'd likely want to remove the ${3} variable from the mix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment