-
-
Notifications
You must be signed in to change notification settings - Fork 145
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
The shell
action in v2.0.5 not working as before (v1.10.1)
#174
Comments
UPDATE: I tried using the full path instead of
I didn't want to hardcode |
@andreoliwa - You might be able to use the environment variable of $USER instead of ~ Such as the two examples below: or
|
This should be fixed in v2.0.6. Can you try it? |
And thank you for the bug reports! They really help 👍 |
Oops, got a bug in there! Please wait before testing |
Ok, please test with 2.0.7. |
Yeah, something was fishy... good thing I used
|
Yep that went very wrong!! I hope nothing's lost? |
Please wait a moment, I'm getting this sorted out. |
I quickly checked the files, I didn't find anything missing yet. 😌 I'm getting a different error now. "ERROR! 'shell' is undefined"
|
I'm so glad to hear that! Which python version are you on? |
Please try the 2.0.8. 2.0.7 is broken |
I upgraded to 2.0.8. I'm still getting the same
Python 3.9.9
|
That's strange. Can you post your full rule? Does this happen only in simulation? |
I could reproduce this with |
Now it's working! 🎉 I's using the latest version from PyPI:
My bad, you're right... the
Yes, that is a good workaround. 👍🏻 |
One more thing: is there a way to show the current output of the Now the output only shows after the command is over. If I remember well, it worked like this in v1.10.1. I can also open a separate issue for this. |
I'm glad it's working now 👍 In the next version you'll be able to specify the value of Just a note: Are you deleting these .DS_Store for every file you find? You can basically do something like this: rules:
- locations:
- path: ~/Desktop/
system_exclude_files: []
subfolders: true
filters:
- name: .DS_Store
actions:
- trash And as of v2, organize can now delete empty directories, too...
This is how it should be, but I have to admit I didn't test with long running commands. I'll look into that! |
Yes, I tried the new syntax as well. 🙂 rules:
- name: "Delete .DS_Store"
locations:
- path: ~/Documents
system_exclude_files: []
- path: ~/Downloads/
system_exclude_files: []
- path: ~/Desktop/
system_exclude_files: []
- path: ~/Library/Mobile Documents/com~apple~QuickTimePlayerX/Documents
system_exclude_files: []
- path: ~/OneDrive/
system_exclude_files: []
subfolders: true
filters:
- name: .DS_Store
actions:
- trash I kept using the I'm planning to rewrite or remove these
Thanks! 🙏🏻 And also many thanks for the super-fast answers, fixes and new releases! 💪🏻 |
Quoto, in the previous version it was possible to see the shell output in real time and this allowed me to be able to act if my intervention was required. For example, among my commands I have |
How about giving the users an option to decide which shell they want to use to execute the Why am I saying so ?As far as I have seen, Python automatically uses Following is the console output when I used >>> import subprocess
>>> subprocess.run('pstree -aps $$ ; ps', shell=True)
systemd,1 rhgb --switched-root --system --deserialize 31
└─systemd,1075 --user
└─plasmashell,1232 --no-respawn
└─konsole,16832
└─zsh,16849
└─python3,16919
└─sh,16952 -c pstree -aps $$ ; ps 👈 See this, sh -c "..." is used
└─pstree,16953 -aps 16952
PID TTY TIME CMD
16849 pts/1 00:00:00 zsh
16919 pts/1 00:00:00 python3
16952 pts/1 00:00:00 ps
CompletedProcess(args='pstree -aps $$ ; ps', returncode=0)
>>> Secondly, giving the user an option to decide the shell will ensure determinism at runtime about which shell is being used to execute the commands they write in the config file and how they are interpreted. Example:
|
Valid points, but can't you do |
Hey, it's me again.
Sorry for being annoying, I hope you don't mind my bug reports. 😬
I'm trying to post one issue at a time, the blockers first... 😅
I'm running the latest version from GitHub (
pipx install git+https://github.com/tfeldmann/organize.git
).The
shell
is not behaving the same way it did before.This is my rule, converted from v1.10.1 and enhanced with the new syntax from v2.0.5:
This is the output:
If I run the command manually, exactly as in the rule, it works:
Somehow shell expansion is not working, the
~/
path is not being expanded.All these directories exist, despite the error in the output:
The text was updated successfully, but these errors were encountered: