webpaste.el icon indicating copy to clipboard operation
webpaste.el copied to clipboard

sending bash script to dpaste.org to dpaste.org gives a "python" type

Open braoult opened this issue 4 years ago • 2 comments

When sending a bash file to dpaste.org, bash scripts are seen as "python".

#!/bin/bash
shopt -s extglob

case $1 in
    [a-z])
        echo indent OK. Case '[a-z]'
        ;;
    +([1-9]))
        echo indent NOK. Case '+([1-9])', extended pattern.
        ;;
    *)
        echo indent still NOK. Case '*', after extended pattern
        ;;
esac # indent still NOK

The buffer is correct (sh-mode), and shebang is correct. I did not test this behavior for other providers.

braoult avatar May 03 '20 16:05 braoult

I can confirm this by executing the following piece of lisp in a buffer in sh-mode and a correct shebang.

(webpaste--get-buffer-language "https://dpaste.org/api/")

Not sure why I get nil back though, it doesn't really make sense to me at the moment. Don't have time to dig in further.

etu avatar May 03 '20 20:05 etu

following my question, someone on #emacsfr made a couple of tests:

  • if shebang is "#!/bin/sh" instead of "#!/bin/bash", it is seen correctly as bash. I double checked, this is right.
  • on paste.mozilla.org, "#!/bin/bash" is javascript, "#!/bin/sh" is bash. I checked too, this is correct.

likely a bug on dpaste side, I will fill a bug report.

braoult avatar May 04 '20 09:05 braoult