#!/bin/sh
# Runs as root after the files are in place. Puts the framework's bin folder on the PATH of the person who
# installed it, as python.org's installer does (Update Shell Profile.command, which they can run again).
# Installer.app sets USER to that person. Tiger's "sudo installer" passes on neither SUDO_USER nor USER (it is
# root), but HOME is still the person's own: its owner is the one.
U=${SUDO_USER:-$USER}
if [ -z "$U" ] || [ "$U" = root ]; then
  U=$(/usr/bin/stat -f %Su "$HOME" 2>/dev/null)
fi
[ -n "$U" ] && [ "$U" != root ] || exit 0
/usr/bin/sudo -u "$U" -H "/Applications/Python @MINOR@/Update Shell Profile.command" >/dev/null 2>&1 || true
exit 0
