edc / bass

Make Bash utilities usable in Fish shell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ValueError when using a particular command

adamtheturtle opened this issue · comments

I saw this error and I expect that bass should not give a Python traceback.

~> bass 'cat <<EOF > mke-options.json
           {
               "service": {
                   "service_account": "kubernetes",
                   "service_account_secret": "kubernetes/sa"
               }
           }
           EOF'
unknown error: need more than 1 value to unpack
Traceback (most recent call last):
  File "/Users/adam/.config/fish/functions/__bass.py", line 90, in <module>
    script = gen_script()
  File "/Users/adam/.config/fish/functions/__bass.py", line 45, in gen_script
    stdout, new_env, alias = output.split(divider, 2)
ValueError: need more than 1 value to unpack
Bass encountered an error!

Thank you for the software!

Thanks for reporting. I pushed a fix. Please give it a try.

Also btw, you don't need to bass to run that command. You can just run it with bash -c.

Thank you @edc - however I have tried bass with the exact command from above after updating and I encountered the same error.

You need to make sure there is no space before EOF for the here document to work properly.

$ bass 'cat <<EOF > mke-options.json
             {
                 "service": {
                     "service_account": "kubernetes",
                     "service_account_secret": "kubernetes/sa"
                 }
             }
EOF'
commented

The fix for this broke returning errors from bass.