fix directory check in discover

the cwd is changed by the time the test is run to see if the name
matches something that is a directory, so we need to build the full path
to the thing for the test
ignore more binary files