#!/bin/bash

function usage
{
    retval="$1"
    case "$retval" in
        0)
            ;;
        *)
            exec 1>&2
            ;;
    esac

    echo "Usage: $0 --help"

    exit "$retval"
}

while [ "$#" -ge 1 ]
do
	case "$1" in
        -h|--help)
            usage 0
            ;;
        *)
            echo "$0: Unrecognized option: $1" 1>&2
            usage 1
            ;;
    esac
    shift
done

case "$(uname -s)" in
    Linux)
        # ./install-package --deb-packages neovim
        # It's probably going to be a while until Debian catches up its neovim with what lunarvim requires.
        sudo apt install ./nvim-linux64.deb
        ;;
	Darwin)
		# This is pretty bleeding edge :)
		./install-package --brew-packages neovim
		;;
    *)
        echo "$0: Unrecognized OS: $(uname -s)" 1>&2
        exit 1
        ;;
esac