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

condition_script doesn't use cwd #259

Closed
Sushisource opened this issue Jul 5, 2019 · 5 comments
Closed

condition_script doesn't use cwd #259

Sushisource opened this issue Jul 5, 2019 · 5 comments
Assignees
Milestone

Comments

@Sushisource
Copy link

Describe the bug
In a condition_script, the cwd value of the task isn't used. This was a little counter-intuitive and took me a bit to figure out. It's easy to work around by cding in the script, but I'd expect it'd use the task cwd. If not, I think the docs should probably mention this in the section about condition_scripts.

Additionally, the condition script won't get the values of anything set in env for that task, which I think makes some sense, but would also be nice to call out in the doc.

To Reproduce
Make a task with a non-root cwd and a condition_script. The working dir for the condition script will be the root directory of the project.

Code Sample

[tasks.bugrepro]
workspace = false
cwd = "some/sub/directory"
category = "Build"
condition_script = [
'''
#!/bin/bash
pwd
'''
]
command = "pwd"

Really love this tool! Thanks for your hard work!

@sagiegurari
Copy link
Owner

@Sushisource ya cwd not impacting the condition script is a bug. will fix that.

env i would prefer to keep as is, as it is 'invocation' of the task same as its command/script and should only happen if conditions are met.
I'll update the docs as you recommended. thanks

@sagiegurari
Copy link
Owner

@Sushisource a fix has been pushed for this in 0.22.0 development branch.
Feel free to test it to see it fixes your issue.

@Sushisource
Copy link
Author

@sagiegurari Confirmed, this fixes it. Thanks!

@sagiegurari
Copy link
Owner

thanks a lot for confirming. an official release will be available start of next week.

@sagiegurari
Copy link
Owner

@Sushisource cargo make 0.22.0 has now been published with the condition cwd fix.

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

2 participants