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

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

Open
braoult opened this issue May 3, 2020 · 2 comments
Open

Comments

@braoult
Copy link

braoult commented May 3, 2020

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.

@etu
Copy link
Owner

etu commented May 3, 2020

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.

@braoult
Copy link
Author

braoult commented May 4, 2020

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.

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