eric-wieser / computercraft-github

A readonly github repository client for computercraft
MIT License
27 stars 15 forks source link

Spaces in directory names give issues #18

Closed krakentoa closed 7 years ago

krakentoa commented 7 years ago

Example: https://github.com/mpoegel/ComputerCraft-Scripts

eric-wieser commented 7 years ago

Good spot, this line needs to url-encode gitpath.

Of course, obviously computercraft does not provide such a url-escape function...

But to fix this issue, I think gitpath:gsub(' ', '%20') would suffice?

krakentoa commented 7 years ago

Worked after escaping the% : gitpath:gsub(' ', '%%20'). Thanks!

eric-wieser commented 7 years ago

That doesn't make much sense - why does it need escaping?

eric-wieser commented 7 years ago

I've committed without the double %% for now, because I really don't understand why two are needed

krakentoa commented 7 years ago

Oh, I got an error of some kind without it. From http://lua-users.org/wiki/PatternsTutorial

Patterns have a few pre-defined classes, use them as "%x", where "x" is the letter identifying the class:

eric-wieser commented 7 years ago

This is not a pattern. It's also not a format string. So % should have no special meaning?

eric-wieser commented 7 years ago

Can you tell me the error you get?

krakentoa commented 7 years ago

I remember now it had something to do with an invalid capture. I also found the actual link that gave me the solution: http://stackoverflow.com/questions/7210581/lua-escaping-literal-inside-string-gsub-and-the-capture-2 I don't have minecraft installed right now.