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

Inavlid arithmetic #1

Open
Pipboyguy opened this issue Nov 5, 2024 · 5 comments
Open

Inavlid arithmetic #1

Pipboyguy opened this issue Nov 5, 2024 · 5 comments

Comments

@Pipboyguy
Copy link

❯ shellm -v "Debug the script behavior."
jq: error (at <stdin>:1): null (null) has no keys
/usr/local/bin/shellm: line 78: TOOLS["$(echo "$tool" | jq -r '.key')"]: bad array subscript
/usr/local/bin/shellm: line 44: [[: Debug the script behavior.: syntax error: invalid arithmetic operator (error token is ".")
/usr/local/bin/shellm: line 45: [[: Debug the script behavior.: syntax error: invalid arithmetic operator (error token is ".")
/usr/local/bin/shellm: line 46: [[: Debug the script behavior.: syntax error: invalid arithmetic operator (error token is ".")
/usr/local/bin/shellm: line 47: [[: Debug the script behavior.: syntax error: invalid arithmetic operator (error token is ".")
/usr/local/bin/shellm: line 44: [[: Debug the script behavior.: syntax error: invalid arithmetic operator (error token is ".")
@Pipboyguy Pipboyguy changed the title zshell behaviour Inavlid arithmetic Nov 5, 2024
@Biont
Copy link
Owner

Biont commented Nov 8, 2024

Hi! The script expects a numeric log level, like -v 3

I probably need to improve the error handling and docs on this

@Pipboyguy
Copy link
Author

ahh! Thanks @Biont

@Pipboyguy
Copy link
Author

Pipboyguy commented Nov 9, 2024

❯ shellm -v 3 "Debug the script behavior."
jq: error (at <stdin>:1): null (null) has no keys
/usr/local/bin/shellm: line 78: TOOLS["$(echo "$tool" | jq -r '.key')"]: bad array subscript

It works now! but still getting the warning

@Biont
Copy link
Owner

Biont commented Nov 9, 2024

I'll check it out asap. Thanks for your patience. I'm still experimenting a lot here

@Biont
Copy link
Owner

Biont commented Nov 9, 2024

@Pipboyguy Currently, the README fails to mention that the script now expects the config file to be present. When I created the readme, the config file was only used for customization/overrides, but I have since moved many of the prompts in there to save space.

So it errors if the config is not there. To fix it, you can just download the config YAML and place it in one of the recognized paths

I will try to make the following changes as soon as I find the time:

  1. Update the README
  2. Bail if no config is found on startup
  3. If no file is found, ask if it shall be downloaded from GH (<- this might be a bonus I'm skipping)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants