detect ry prefix based on the script's location