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

Indentation issue with if statements that have a semicolon on their closing 'fi' #14

Closed
a-tyler opened this issue Mar 24, 2019 · 0 comments

Comments

@a-tyler
Copy link

a-tyler commented Mar 24, 2019

Looks like ef2e050 didnt 100% fix the indentation issue for if statements that have a semicolon on their closing 'fi'.
Example:
Before indent:

#!/bin/bash
if [ "$1" == "test" ];
then
echo "$1";
fi;
if [ "$1" == "1" ];
then
echo "test";
fi;
if [ "$2" == "2" ];
then
echo "test";
fi;

After indent with closing semicolons on 'fi'.

#!/bin/bash
if [ "$1" == "test" ];
then
  echo "$1";
  fi;
  if [ "$1" == "1" ];
  then
    echo "test";
    fi;
    if [ "$2" == "2" ];
    then
      echo "test";
      fi;

After indent without closing semicolons on 'fi'.

#!/bin/bash
if [ "$1" == "test" ];
then
  echo "$1";
fi
if [ "$1" == "1" ];
then
  echo "test";
fi
if [ "$2" == "2" ];
then
  echo "test";
fi

Let me know if you need any other information.

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

1 participant