uber/needle

Cannot use Needle generate command on directories with spaces in their name

tinder-maxwellelliott opened this issue · 2 comments

Hello There,

I am running this command locally and I am seeing an internal error from within Needle

needle generate My\ Repo/NeedleGenerated.swift MyRepo\ Sources/

But if I run this same command without spaces in the directory names it works. Any tips here? It looks like an issue from within the library itself

rudro commented

So we're using this : https://developer.apple.com/documentation/foundation/nsurl/1413146-init, which requires that we do the %20 thing for the space. Unfortunately, you can't just put a %20 and fix it, as we also use https://developer.apple.com/documentation/foundation/filemanager/1410277-fileexists (to decide if the input is a directory or a file) which does not handle the %20 well.

I'll need to add a addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) in the swift-common repo, so might take a little bit to get released, or if you're building from source, you can make the change while you wait.

@tinder-maxwellelliott Did you find a way to escape the space that will work with Needle?