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

Beautysh does nothing #98

Open
starty-arty opened this issue Aug 6, 2021 · 2 comments
Open

Beautysh does nothing #98

starty-arty opened this issue Aug 6, 2021 · 2 comments

Comments

@starty-arty
Copy link

I installed beautysh as pip install beautysh, and then tried to run it but it did nothing.

~ ❱❱❱ python --version
Python 3.9.6
~ ❱❱❱ cat temp.sh
echo "meep"|grep "e";echo "no u"~ ❱❱❱ 
~ ❱❱❱ beautysh temp.sh 
~ ❱❱❱ cat temp.sh
echo "meep"|grep "e";echo "no u"~ ❱❱❱ 
@AmyMoriyama
Copy link

I tried this on some of my somewhat messy scripts and it did nothing apparently. I used the -b argument and it didn't even backup anything so I presume the program itself is broken somehow. Not well versed in python so I can't check it out.

@devenes
Copy link

devenes commented Nov 9, 2022

Hi @starty-arty,

I installed beautysh as pip install beautysh, and then tried to run it but it did nothing.
echo "meep"|grep "e";echo "no u"

Actually there is nothing to beautify in your example. There is no best practice for using pipes and semicolons. So, beautysh does nothing.
But we agree that if statements should be formatted in a special way with indentation.
I recommend using beautysh on files containing lots of loops, if statements, etc.

If you try this example;

        if [[ $(id -u) != "0" ]]; then
echo "Error: You must be root to run this script."
else
echo "Installing ..."
        fi

will be changed to:

if [[ $(id -u) != "0" ]]; then
    echo "Error: You must be root to run this script."
else
    echo "Installing ..."
fi

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

3 participants