Take a matched glob if it is a directory