chrissimpkins / glue

Glue is a plugin that joins your shell to Sublime Text in quasi-perfect harmony.
http://gluedocs.readthedocs.org/
MIT License
254 stars 10 forks source link

Issue with Custom Extension (Possible string formatting issue) #29

Closed CommandLineDesign closed 9 years ago

CommandLineDesign commented 9 years ago

I'm trying to use Glue to set up some commands to work with the SourceGear Vault source control my company uses. I created a custom extension to attempt to execute some commands and I've hit a road block.

gitbashresult

glueresult

I've got my extension to the point where the command matches the working GitBash command 100% but my --repository command is still cut off at the empty space.

Edit: Forgot to include the code:

image

chrissimpkins commented 9 years ago

can you try escaping that space in wsn repository? It looks like it is reading your repository request as wsn instead of wsn repository

CommandLineDesign commented 9 years ago

How do you escape it? Edit: I tried escaping with ^. It didn't work but I'll research down that path a bit more.

chrissimpkins commented 9 years ago

I am not familiar with escapes in ming, but it looks like you used \ to escape your \ path characters on the F drive path. Try this and see if it works:

--repository 'wsn\ repository'

alternatively, try it with two sets of single quotes around that argument:

--repository ''wsn repository''
CommandLineDesign commented 9 years ago

Got this Trace when I tried to escape with \ there.

Traceback (most recent call last): File "Glue in C:\Users\John\AppData\Roaming\Sublime Text 3\Installed Packages\Glue.sublime-package", line 163, in muterun_runner File "Glue in C:\Users\John\AppData\Roaming\Sublime Text 3\Installed Packages\Glue.sublime-package", line 382, in muterun File "./json/init.py", line 319, in loads File "./json/decoder.py", line 352, in decode File "./json/decoder.py", line 368, in raw_decode ValueError: Invalid \escape: line 2 column 104 (char 106)

chrissimpkins commented 9 years ago

The JSON parser doesn't seem to like that. I came across this post (which is mostly unhelpful but explains the ming space woes).

stack overflow

Unfortunately I don't have a windows test box with ming and my windows command line knowledge is very limited so it is difficult for me to help troubleshoot this with you. They do mention something called Windows short paths (see answer 2) but it doesn't sound like this applies to your problem. Hopefully this is a starting point to explore the issue a bit more.

Let me know if you find a solution and I will pass it along to other windows users.

CommandLineDesign commented 9 years ago

Thanks, I know this is obscure and specific to me. I appreciate you taking the time to help me out. If I find a solution I will definitely update here.

chrissimpkins commented 9 years ago

No worries at all. Wish I could be of more help!

chrissimpkins commented 9 years ago

Let me know if you do find a solution and I will put it in the documentation.

CommandLineDesign commented 9 years ago

I was able to make it work like this: -repository \"'Repository Name'\"

I'm guessing this has something to do with the string being encoded multiple times? Hopefully this will be helpful to someone, thanks again!

chrissimpkins commented 9 years ago

You are correct. Congratulations and thanks for stopping back over to let me know. I will update the docs with this info. I am sure the question will come up again.

postite commented 9 years ago

was usefull to me .. thx

chrissimpkins commented 9 years ago

thanks to @CommandLineDesign