Filters should reject empty options #523
Replies: 2 comments 5 replies
-
Hi, thanks for your kind words and for posting. Can you provide the most minimal bashly.yml file to demonstrate the issue? I am trying to understand if this is a bug (most likely), or a misuse/misunderstanding (by that I mean that allowing empty strings ( Although I don't mind making the change myself (assuming it is needed), if you want to test it yourself, perhaps these few steps will help:
But before that, I would prefer seeing a sample YAML so I can reproduce and ponder. |
Beta Was this translation helpful? Give feedback.
-
Sure thing, you just need a command with a command with an argument that has the following:
Then in the generated file in
We have several people using this in Ubuntu (including myself) and it works, however, whatever version of bash that I'm using on my other machine, so this probably won't break for you but you should still see the In the meantime in our side I have also made the fix to remove the Regarding the steps that you provided they all work ok but for some reason when I'm running it, it wasn't really adding my changes. After having created a
it now works. My proposed solution does eliminate the issue, but let me know if you'd rather go the route of preventing people from having empty options in those lists. |
Beta Was this translation helpful? Give feedback.
-
Hello!
First of all, thank you for the great project @DannyBen . It just works and the project seems quite well maintained.
In our project we have a command which has an
allowed
list with multiple entries. However one of the entries is""
which is also the default value. This hasn't been a issue so far but today I started using this project in MacOS and it failed because of this. For the record I already installed a more up to date version ofbash
though I'm not exactly sure if that is what is used when running our script.The issue seems to be with the following:
Notice the
|
after the last entry. The error message isargument must be one of entry1, entry2,
I think the proper fix is to change:
to
I wanted to test this but I'm having some difficulties trying to properly compile the bashly project and testing it on my other project. I tried to find some instructions but really couldn't. It's probably not so hard but I never worked with Ruby.
Depending on if the solution above is the correct one I might make a PR to add this fix, though I wouldn't really know if there are other changes that would be required (like tests etc).
Please let me know if there are any other things I should test.
Beta Was this translation helpful? Give feedback.
All reactions