#!/usr/bin/env bash
# wrapper to avoid the `gio` bug which doesn't wait for the application to activate
# (which for some reason causes it to exit again)

if [[ "$1" == "open" && -d "${2#file://}" ]]; then
	echo "$0: redirecting to 'gapplication launch'" >&2
	exec gapplication launch org.gnome.Nautilus "$2"
fi

exec /usr/bin/gio "$@"
