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

Allow not escaped commands #99

Closed
wouterj opened this issue Jul 26, 2014 · 5 comments
Closed

Allow not escaped commands #99

wouterj opened this issue Jul 26, 2014 · 5 comments

Comments

@wouterj
Copy link
Contributor

wouterj commented Jul 26, 2014

I need to use Bash variables in my commands, e.g.: git push https://${GH_TOKEN}@github.com/.... The ProcessBuilder escapes each argument, resulting in 'git' 'push' 'https://${GH_TOKEN}@gihub.com/'. This causes my build to fail, since the authentication is no longer correct.

I propose to add an option called raw. When it's set to true, it'll simply execute implode(' ', $arguments) instead of using the ProcessBuilder.

@cryptiklemur
Copy link
Member

-
    type: exec
    executable: git
    arguments:
        - push
        - https://$GH_TOKEN$@github.com/...

Shouldn't that work?

@wouterj
Copy link
Contributor Author

wouterj commented Jul 26, 2014

@aequasi no, as said, that'll be converted to:

'git' 'push' 'https://$GH_TOKEN@github.com/...'

Anything between single quotes get not parsed, so GH_TOKEN will not be parsed here. This happends on this line of the ProcessBuilder: https://github.com/symfony/Process/blob/master/ProcessBuilder.php#L270

@cordoval
Copy link
Contributor

I am taking the risk here for getting involved in @wouterj's affairs but just want to mention this https://github.com/gushphp/gush/blob/master/src/Helper/ProcessHelper.php#L181-L197 not sure if it is related. I will not continue replying any responses for my sake. 😊

@cryptiklemur
Copy link
Member

@wouterj i put in environment variable token support. What i posted will work, but you need the $ after $GH_TOKEN

@cryptiklemur
Copy link
Member

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

No branches or pull requests

3 participants