question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. Itย collects links to all the places you might be looking at while hunting down a tough bug.

And, if youโ€™re still stuck at the end, weโ€™re happy to hop on a call to see how we can help out.

The `shell` action in v2.0.5 not working as before (v1.10.1)

See original GitHub issue

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:

rules:
  - name: "Remove some hidden files and then remove empty dirs"
    locations: ~/
    filters:
      - name:
          startswith: .bash_history
    actions:
      - shell:
          cmd: "fd -uu -0 -tf -i .DS_Store ~/Downloads ~/Desktop ~/OneDrive ~/Documents | xargs -0 rm -v"
          ignore_errors: true
      - echo: "{shell.output}"
      - shell:
          cmd: "fd -uu -0 -tf -i .nomedia ~/Downloads ~/Desktop ~/OneDrive ~/Documents | xargs -0 rm -v"
          ignore_errors: true
      - echo: "{shell.output}"
      - shell:
          cmd: "find -f ~/Downloads -f ~/Desktop -f ~/Documents ~/OneDrive -mindepth 1 -type d -empty -print -delete"
          ignore_errors: true
      - echo: "{shell.output}"

This is the output:

โฏ organize run
organize 2.0.5
Config: "/Users/aa/Library/Application Support/organize/config.yaml"

โš™ Remove some hidden files and then remove empty dirs โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
/Users/aa
  .bash_history
    - (shell) $ fd -uu -0 -tf -i .DS_Store ~/Downloads ~/Desktop ~/OneDrive ~/Documents | xargs -0 rm -v
    - (echo) error: Found argument '-v' which wasn't expected, or isn't valid in this context
    - (echo)
    - (echo) USAGE:
    - (echo)     fd [FLAGS/OPTIONS] [<pattern>] [<path>...]
    - (echo)
    - (echo) For more information try --help
    - (shell) $ fd -uu -0 -tf -i .nomedia ~/Downloads ~/Desktop ~/OneDrive ~/Documents | xargs -0 rm -v
    - (echo) error: Found argument '-v' which wasn't expected, or isn't valid in this context
    - (echo)
    - (echo) USAGE:
    - (echo)     fd [FLAGS/OPTIONS] [<pattern>] [<path>...]
    - (echo)
    - (echo) For more information try --help
    - (shell) $ find -f ~/Downloads -f ~/Desktop -f ~/Documents ~/OneDrive -mindepth 1 -type d -empty -print -delete
    - (echo) find: ~/Downloads: No such file or directory
    - (echo) find: ~/Desktop: No such file or directory
    - (echo) find: ~/Documents: No such file or directory
    - (echo) find: ~/OneDrive: No such file or directory

success 1 / fail 0

If I run the command manually, exactly as in the rule, it works:

โฏ fd -uu -0 -tf -i .DS_Store ~/Downloads ~/Desktop ~/OneDrive ~/Documents | xargs -0 rm -v
/Users/aa/Desktop/.DS_Store
/Users/aa/OneDrive/.DS_Store

Somehow shell expansion is not working, the ~/ path is not being expanded. All these directories exist, despite the error in the output:

    - (echo) find: ~/Downloads: No such file or directory
    - (echo) find: ~/Desktop: No such file or directory
    - (echo) find: ~/Documents: No such file or directory
    - (echo) find: ~/OneDrive: No such file or directory

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:21 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
tfeldmanncommented, Feb 9, 2022

Please wait a moment, Iโ€™m getting this sorted out.

1reaction
enricomarognacommented, Apr 28, 2022

One more thing: is there a way to show the current output of the shell command being executed instead of โ ด organizing with the animated icon?

Now the output only shows after the command is over. If itโ€™s a long-running command, I donโ€™t see whatโ€™s going on.

If I remember well, it worked like this in v1.10.1.

I can also open a separate issue for this.

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 brew upgrade, which allows you to update installed packages and it is possible that my intervention may be required, to confirm an action or to enter the root password. If this happens, now โ ด organizing remains in the loop because it is not possible to intervene in the shell.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Electron failed to install correctly, please delete ... - GitHub
I can not use Electron because it is not installed correctly, despite using the shell in administrator mode. Note that when installingย ...
Read more >
Fix list for IBM WebSphere Application Server V8.5
IBM WebSphere Application Server provides periodic fixes for the base and Network Deployment editions of release V8.5. The following is a complete listingย ......
Read more >
Max retries exceeded with URL in requests - Stack Overflow
Just use requests features: import requests from requests.adapters import HTTPAdapter from urllib3.util.retry import Retry session = requests.
Read more >
Avaya Auraยฎ 10.1.x.x Release Notes
Avaya does not guarantee that these links will work all the time and has no control over the availability of the linked pages....
Read more >
Changelog | Meteor API Docs
needs to use directly from npm the meteorjs/babel@7.16.1-beta.0. Breaking Changes. N/A. Migration Steps. Meteor Version Release. mongo@1.16.2 :.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found