-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Concerning behaviour when actions run bash commands #57258
Comments
This action starts a single process, not a shell script. See also https://stackoverflow.com/a/20901985 |
I see what you mean, thanks. I was lead astray by the documentation which says https://docs.qgis.org/3.34/en/docs/training_manual/create_vector_data/actions.html
Indeed, a quick browse of my home folder reveals the directories "&&" and "touch". So the behaviour is fully explained, but the documentation may need adjusting? Or is it just my poor interpretation? |
Indeed, thanks for pointing out. Would you mind proposing a better wording in https://github.com/qgis/QGIS-Documentation/edit/master/docs/training_manual/create_vector_data/actions.rst ? |
No problem. I don't know how (I've never contributed directly to a Github project before), but I can work that out, it might take me while is all. I'd suggest the wording only needs tweaking, had it said
... that certainly would have clarified things for me personally |
That's great! |
Ah... it may be not quite so simple then because the link you provided just takes me to a page with
Whereas the guidelines you've linked to suggest an...
... which, unless I'm being really dense (a possibility!), is just not there on the page your first link directs me to (one big "green button" though with 'Fork this repository' on it, which sounds more substantial an action than I was expecting) I don't want to mess anything up, but also I'm aware you time is limited and guiding a noob through editing a simple text file is probably not the best use of it. Any help would be much appreciated, but also, I'm quite happy to just wade through the manuals until I get it... I generally just 'tinker' on my own computer and learn that way, not quite such a sensible approach on a globally significant shared repository perhaps... |
No worries really! We are always happy to enable people to help contribute and additional help on the documentation is very welcome ! Here's what you need to do: click on the "Fork this repository" button. This is a one-time action which creates a copy of the documentation for you on your github account. If you run into any blocking issues or uncertainties, don't hesitate to ask again. |
Just made a minor change to the wording here in response to qgis/QGIS#57258 making it clearer that it is 'processes' that can be called from shell, not just any command (eg boolean commands won't work)
Cool, thanks. I've done that (I think - either that or I've wiped the entire repository and you'll all have to start again!) But on reading through, I think the bit that needs clarifying more is in the other section of 'Actions' here https://docs.qgis.org/3.34/en/docs/user_manual/working_with_vector/vector_properties.html#defining-actions Where I'd like to add
If that makes sense? |
Good progress I think it would make more sense to say that "Actions can invoke a single process with arguments" and then explain that for Btw, you can very well type this proposal and click your way through to a pull request. We (including you) can then still fine tune this until it's ready. |
OK, I've made the changes I think will work. I made them on the version in my repository (the 'forked' version), which, it turns out, has all the documentation in it, clicked on 'commit changes' but it's asking...
...and I'm afraid I can't recall which I did last time I thought it was the 'pull request' one, but the 'master branch' is set as the default option... |
Let's walk through this quickly together: Here are all currently open pull requests listed: https://github.com/qgis/QGIS-Documentation/pulls You can click on it to see a discussion. You will there also notice a tab "Files changed". Within this, you will be able to continue editing your already open proposal. Only if you want to start a completely new documentation change in the future, you will need to redo the workflow. I hope that makes sense. |
Adding the same clarification on command line actions to the user manual as in qgis/QGIS#57258
Thanks, that's all quite clear. I've made the second pull request to just follow through the additional information into the user manual, which I think is all that's required. I really appreciate you taking the time to provide guidance. |
Just made a minor change to the wording here in response to qgis/QGIS#57258 making it clearer that it is 'processes' that can be called from shell, not just any command (eg boolean commands won't work)
Just made a minor change to the wording here in response to qgis/QGIS#57258 making it clearer that it is 'processes' that can be called from shell, not just any command (eg boolean commands won't work)
Just made a minor change to the wording here in response to qgis/QGIS#57258 making it clearer that it is 'processes' that can be called from shell, not just any command (eg boolean commands won't work)
A pleasure, thank you |
Adding the same clarification on command line actions to the user manual as in qgis/QGIS#57258
What is the bug or the crash?
I've created an action which is;
when I run the action the new directory is created and another new directory is created within that using the pathtonewtextfile_field.
I've set the action to capture output, copied the output, pasted it into the console and run it from there - it does exactly what it's supposed to do (create a directory, then a text file within it)
so when the exact output is run from the console it creates a directory and text file, when it's run from Qgis actions it creates a directory and a subdirectory.
Nothing more than an annoyance on it's own, but a massive flaw if Qgis is not faithfully running the script as written, it could lead to all sorts of serious breakages.
Steps to reproduce the issue
mkdir -p [%directorypath_field%] && touch [%pathtonewtextfile_field%]
Versions
<style type="text/css"> p, li { white-space: pre-wrap; } </style>Active Python plugins
TomBio
3.4.2
pluginbuilder3
3.2.1
db_manager
0.1.20
processing
2.12.99
grassprovider
2.12.99
otbprovider
2.12.99
Supported QGIS version
New profile
Additional context
Each command works as an action separately ie
mkdir -p [%directorypath_field%]
makes a directory andtouch [%pathtonewtextfile_field%]
creates a text file at that location if the directory existsThe text was updated successfully, but these errors were encountered: