Check if NAME is dir before using as default package name.