# Guider Launcher
#
# Copyright (c) 2016-2021 Peace Lee <iipeace5@gmail.com>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.

# check python #
if [ ! $PYTHON ]
    then
        PYTHON=$(which python)
        if [ ! $PYTHON ]
            then
                PYTHON=$(which python3)
		if [ ! $PYTHON ]
                    then
                        PYTHON=$(which python2)
		        if [ ! $PYTHON ]
                            then
                                echo "[Error] fail to find python"
                                exit
                        fi
                fi
        fi
fi

# export CMDLINE for Guider #
CMDLINE=$0
export CMDLINE

# launch Guider #
$PYTHON -m guider $*

exit 0
