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

elif has wrong indentation #2

Closed
monotek opened this issue Feb 12, 2017 · 0 comments
Closed

elif has wrong indentation #2

monotek opened this issue Feb 12, 2017 · 0 comments
Assignees
Labels

Comments

@monotek
Copy link

monotek commented Feb 12, 2017

If you have something like:

#!/bin/bash

if [ -f testfile1 ]; then
    echo "1"
elif [ -f testfile2 ]; then
    echo "2"
else
    echo "3"
fi

The result is:

#!/bin/bash

if [ -f testfile1 ]; then
  echo "1"
  elif [ -f testfile2 ]; then
  echo "2"
else
  echo "3"
fi

So it seems elif is not handled correctly.

@lovesegfault lovesegfault self-assigned this Feb 13, 2017
jwhonce added a commit to jwhonce/beautysh that referenced this issue Jun 9, 2017
Fixes lovesegfault#2

Signed-off-by: Jhon Honce <jhonce@redhat.com>
trystero11 added a commit to trystero11/beautysh that referenced this issue May 3, 2021
Make the ad-hoc oudent (added in lovesegfault#2) apply only when `elif` is followed by `then` on the same line. In my testing, this addresses lovesegfault#57 without breaking the lovesegfault#2 test case. I'm sure the regex could be cleaned up, though.
trystero11 pushed a commit to trystero11/beautysh that referenced this issue May 3, 2021
trystero11 added a commit to trystero11/beautysh that referenced this issue May 3, 2021
lovesegfault pushed a commit that referenced this issue May 3, 2021
Make the ad-hoc oudent (added in #2) apply only when `elif` is followed by `then` on the same line. In my testing, this addresses #57 without breaking the #2 test case.

Test case to be added in #76
trystero11 added a commit to trystero11/beautysh that referenced this issue May 3, 2021
…vesegfault#57)

Make the ad-hoc oudent (added in lovesegfault#2) apply only when `elif` is followed by `then` on the same line. In my testing, this addresses lovesegfault#57 without breaking the lovesegfault#2 test case.

Test case to be added in lovesegfault#76
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants