Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to work with different quoting styles that worked in previous client #141

Closed
thigg opened this issue Mar 3, 2015 · 15 comments
Closed

Comments

@thigg
Copy link

thigg commented Mar 3, 2015

The currently working method to use the current path is "%cd".
At least here:
https://github.com/chocolatey/choco/wiki/CreatePackages#testing-your-package
The documentation suggestes '%cd%'

*From Rob: * Some of the documentation was plain wrong and leaned towards cmd.exe - single tick marks have probably never worked in powershell.exe that I'm aware of. That's why the '"stuff"' (apostrophe followed by a double quote) in some parts of the documentation.

@ghost
Copy link

ghost commented Mar 3, 2015

I almost went out the door with scripts that are now broken due to this.
Was the breaking of backwards compatibility on purpose? It worked BEFORE 0.9.9

This isn't just when referencing the current location, but when specifying ANY source.

@thigg
Copy link
Author

thigg commented Mar 3, 2015

I think this was not intentional, as far as I understand this is just the way Windows deals with cmd inputs. It seems to be different if the target is a posh-script

@ferventcoder
Copy link
Member

@ryanroundhouse this is a breaking change, not necessarily intentional. What did you have before? We can attempt to bring about something that will allow this to work with new choco.

@ferventcoder ferventcoder changed the title Documentation: reference to current location in cmd with "%cd%" Attempt to work with updates - Reference to current location in cmd with "%cd%" Mar 3, 2015
@ferventcoder
Copy link
Member

The problem here is we removed a bunch of layers. Before it was shim -> cmd -> powershell (jumping through hoops to ensure quotes made it all the way down). Now it is just shim -> exe.

@ghost
Copy link

ghost commented Mar 3, 2015

I was using the same thing as thigg. The documentation he linked to suggested using apostrophes around paths (ie: 'c:\program files (x86)\path\to local\store;http://chocolatey.org/api/v2/').

It now complains that the package cannot be found and it is checking:
Source(s): "'c:\program"

@thigg
Copy link
Author

thigg commented Mar 3, 2015

Would be nice to be backward compatible, also for scripts which are using chocolatey.

@ferventcoder
Copy link
Member

agreed. Adjusted. this should be 0.9.9.1

@thigg
Copy link
Author

thigg commented Mar 3, 2015

So it should allow "test" 'test' and '"test'" (single, double and combined)?

@ferventcoder
Copy link
Member

Also keep in mind that we can only do so much here. There is a difference between how powershell handles and how cmd handles it.

@ferventcoder
Copy link
Member

In some places we've already tried to cover that - powershell may have never handled single quotes.

@thigg
Copy link
Author

thigg commented Mar 3, 2015

But if the target is an exe file, we should be able to do the whole formatting as we like it, right?

@ferventcoder ferventcoder added this to the 0.9.9.1 milestone Mar 3, 2015
@ferventcoder
Copy link
Member

It should work as much the same way as before - I think the single tick marks apostrophes would may have only worked on cmd.exe - powershell would have stripped it right off.

@ferventcoder ferventcoder changed the title Attempt to work with updates - Reference to current location in cmd with "%cd%" Attempt to work with different quoting styles that worked in previous version Mar 3, 2015
@ferventcoder ferventcoder changed the title Attempt to work with different quoting styles that worked in previous version Attempt to work with different quoting styles that worked in previous client. Mar 3, 2015
@ferventcoder ferventcoder changed the title Attempt to work with different quoting styles that worked in previous client. Attempt to work with different quoting styles that worked in previous client Mar 3, 2015
@ghost
Copy link

ghost commented Mar 3, 2015

I was using apostrophe, not a tick.

On Tue, Mar 3, 2015 at 1:49 PM, Rob Reynolds notifications@github.com
wrote:

It should work as much the same way as before - I think the single tick
marks would have only worked on cmd.exe - powershell would have stripped it
right off.


Reply to this email directly or view it on GitHub
#141 (comment).

@ferventcoder
Copy link
Member

I was using apostrophe, not a tick.

Yeah sorry, I use those terms interchangeably (and technically incorrectly) meaning apostrophe. Backtick being something different.

@ferventcoder ferventcoder modified the milestones: 0.9.9.1, 0.9.9.2 Mar 3, 2015
ferventcoder added a commit that referenced this issue Mar 6, 2015
When command has an option passed in with surrounding apostrophes, e.g.
`--some-param='some value'`, remove the apostrophes from the value.
ferventcoder added a commit that referenced this issue Mar 6, 2015
* stable:
  (GH-153) Upgrade -r should always return a value
  (GH-141) Handle option w/surrounding apostrophes
  (maint) Correcting typos
@ferventcoder ferventcoder self-assigned this Mar 6, 2015
@ferventcoder
Copy link
Member

So chocolatey will properly handle apostrophes again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants