#!/usr/bin/env bash

output_file=~/.hcm/gui-output
echo "$0: Output will be left in $output_file" 1>&2

exec > "$output_file" 2>&1
set -x

if [ -r ~/.bashrc ]
then
	# shellcheck disable=SC1090
	source ~/.bashrc
fi

# macOS (homebrew) likes to keep python3 in /usr/local/bin.
PATH="$HOME/bin:/usr/local/bin:$PATH"
export PATH

if [ "$#" = 0 ]
then
	hcm.py --gui
else
	hcm.py "$@"
fi