Error When Calling Bunch Cli from Shortcuts #303
Replies: 4 comments
-
I'm not sure why the url_generator is being called on this, but that's
where the error is. It's getting some kind of invalid ASCII. You might
try running `/opt/homebrew/opt/ruby/bin/bunch -t
Test` (adding the -t flag for toggle, or -o/-c for open/close). Not sure
that would make a difference, something seems to be being passed in
addition to the raw command...
Rather than using the CLI, have you tried using the URL handler? You
could use the CLI to generate whatever URL you needed with `bunch -i`,
then open that URL with Shortcuts.
…-Brett
On 23 Aug 2023, at 18:46, SteveMattan wrote:
I am attempting to run a Bunch via the Run Shell Script command in
macOS Shortcuts. And I am not meeting with success.
Due to my own error, I had some difficulty installing the bunch
command line tool. I did get it sorted. You can read about it here:
#302
When I use the command "bunch" directly in iTerm, it works fine. The
command is in my path. However, in Shortcuts I need to provide the
full path. Something I do not need to do when using other items in the
/opt/homebrew/opt/ruby/bin directory.
For example, if in the Shortcut I run "gem -h" I get the expected
output, no path needed.
If I run "bunch - h", the Shortcut fails with the error, "command not
found: bunch".
If I run "/opt/homebrew/opt/ruby/bin/bunch -h", there is no error and
I get the expected output.
If I then run the Shortcut with the command
"/opt/homebrew/opt/ruby/bin/bunch Test", where "Test" is a bunch file,
it fails with the following error message:
---
Run Shell Script finished with an error.
/opt/homebrew/lib/ruby/gems/3.2.0/gems/bunchcli-1.1.14/lib/bunch/url_generator.rb:29:in
`strip': invalid byte sequence in US-ASCII
(Encoding::CompatibilityError)
from
/opt/homebrew/lib/ruby/gems/3.2.0/gems/bunchcli-1.1.14/lib/bunch/url_generator.rb:29:in
`bundle_id'
from
/opt/homebrew/lib/ruby/gems/3.2.0/gems/bunchcli-1.1.14/lib/bunch/bunchCLI.rb:154:in
`open'
from
/opt/homebrew/lib/ruby/gems/3.2.0/gems/bunchcli-1.1.14/bin/bunch:117:in
`block in <top (required)>'
from
/opt/homebrew/lib/ruby/gems/3.2.0/gems/bunchcli-1.1.14/bin/bunch:117:in
`map'
from
/opt/homebrew/lib/ruby/gems/3.2.0/gems/bunchcli-1.1.14/bin/bunch:117:in
`<top (required)>'
from /opt/homebrew/opt/ruby/bin/bunch:25:in `load'
from /opt/homebrew/opt/ruby/bin/bunch:25:in `<main>'
---
Any insight into what I am doing wrong would be appreciated.
And of course, let me know if I can provide any additional
information.
Thanks,
SteveM
--
Reply to this email directly or view it on GitHub:
#303
You are receiving this because you are subscribed to this thread.
Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Thank you for the prompt reply. Using iTerm I tried "bunch -I", with these results: ~ ➤ bunch -i ┌──────────────────────────────────────────────────────────────────────────┐ ~ ➤ Something is clearly not right here. Any suggestions on how to proceed would be welcomed and appreciated. Thanks again, SteveM |
Beta Was this translation helpful? Give feedback.
-
Looks like I have some debugging to do on the cli. Haven't looked at it in a while, not tested with Ruby 3.2. In the meantime, the documentation is very complete and you can write your own urls.
https://bunchapp.co/docs/integration/url-handler/
Thanks,
Brett
…On Aug 24, 2023 at 11:30 AM -0500, SteveMattan ***@***.***>, wrote:
Thank you for the prompt reply.
Using iTerm I tried "bunch -I", with these results:
~ ➤ bunch -i
┌──────────────────────────────────────────────────────────────────────────┐
│1: Open a Bunch │
│2: Close a Bunch │
│3: Toggle a Bunch │
│4: Load a Snippet │
│5: Load raw text │
└┤ Select an item ├────────────────────────────────────────────────────────┘
/opt/homebrew/lib/ruby/gems/3.2.0/gems/bunchcli-1.1.14/lib/bunch/url_generator.rb:52:in choose_number': undefined method =~' for true:TrueClass (NoMethodError)
from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bunchcli-1.1.14/lib/bunch/url_generator.rb:161:in choose' from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bunchcli-1.1.14/lib/bunch/url_generator.rb:299:in generate'
from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bunchcli-1.1.14/bin/bunch:72:in block (2 levels) in <top (required)>' from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/optparse.rb:1694:in block in parse_in_order'
from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/optparse.rb:1636:in catch' from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/optparse.rb:1636:in parse_in_order'
from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/optparse.rb:1630:in order!' from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/optparse.rb:1739:in permute!'
from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/optparse.rb:1764:in parse!' from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bunchcli-1.1.14/bin/bunch:104:in <top (required)>'
from /opt/homebrew/opt/ruby/bin/bunch:25:in load' from /opt/homebrew/opt/ruby/bin/bunch:25:in
'
~ ➤
Something is clearly not right here.
Any suggestions on how to proceed would be welcomed and appreciated.
Thanks again,
SteveM
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Ok. Thank you once again. And if you need anything more, or would like me to test anything, let me know. Stay well. SteveM |
Beta Was this translation helpful? Give feedback.
-
I am attempting to run a Bunch via the Run Shell Script command in macOS Shortcuts. And I am not meeting with success.
Due to my own error, I had some difficulty installing the bunch command line tool. I did get it sorted. You can read about it here:
#302
When I use the command "bunch" directly in iTerm, it works fine. The command is in my path. However, in Shortcuts I need to provide the full path. Something I do not need to do when using other items in the /opt/homebrew/opt/ruby/bin directory.
For example, if in the Shortcut I run "gem -h" I get the expected output, no path needed.
If I run "bunch - h", the Shortcut fails with the error, "command not found: bunch".
If I run "/opt/homebrew/opt/ruby/bin/bunch -h", there is no error and I get the expected output.
If I then run the Shortcut with the command "/opt/homebrew/opt/ruby/bin/bunch Test", where "Test" is a bunch file, it fails with the following error message:
Run Shell Script finished with an error.
/opt/homebrew/lib/ruby/gems/3.2.0/gems/bunchcli-1.1.14/lib/bunch/url_generator.rb:29:in
'strip': invalid byte sequence in US-ASCII (Encoding::CompatibilityError) from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bunchcli-1.1.14/lib/bunch/url_generator.rb:29:in
bundle_id'from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bunchcli-1.1.14/lib/bunch/bunchCLI.rb:154:in
open' from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bunchcli-1.1.14/bin/bunch:117:in
block in <top (required)>'from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bunchcli-1.1.14/bin/bunch:117:in
map' from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bunchcli-1.1.14/bin/bunch:117:in
<top (required)>'from /opt/homebrew/opt/ruby/bin/bunch:25:in
load' from /opt/homebrew/opt/ruby/bin/bunch:25:in
macOS v 13.5.1
Bunch CLI v 1.1.14
Bunch v 1.4.13 (173)
Any insight into what I am doing wrong would be appreciated.
And of course, let me know if I can provide any additional information.
Thanks,
SteveM
Beta Was this translation helpful? Give feedback.
All reactions