automatically detect directory of current script