Genericize publish.sh

Made the publish script work no matter the invoking path.