#!/bin/sh

export GJS_PATH="/usr/local/share/gnome-maps/js${GJS_PATH:+:$GJS_PATH}"

if test x"$GJS_DEBUG_OUTPUT" = x ; then
    export GJS_DEBUG_OUTPUT=stderr
fi

if test x"$GJS_DEBUG_TOPICS" = x ; then
    export GJS_DEBUG_TOPICS="JS ERROR;JS LOG"
fi

DEBUG_COMMAND=""
if test x"$MAPS_RUN_DEBUG" != x; then
    DEBUG_COMMAND="gdb --args"
fi

exec $DEBUG_COMMAND /usr/local/bin/gjs-console -I /usr/local/share/gnome-maps/js -c "const Main = imports.main; Main.start();" "$@"
