Fix check for pre-existing project

Check was using grep in an ambiguous fashion, so that `project`
would exist if there was a project `other-project`.