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

Please apply some bash coding standards #452

Open
skyf0l opened this issue Mar 2, 2025 · 0 comments
Open

Please apply some bash coding standards #452

skyf0l opened this issue Mar 2, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@skyf0l
Copy link

skyf0l commented Mar 2, 2025

It's hell to code with “format on save” because there don't seem to be any code standards: sometimes there are 2-space indentations, and other times it's 4-space indentations, even in the same file...

function add-to-list() {
echo "$1" >> "/.exegol/installed_tools.csv"
}
function add-aliases() {
colorecho "Adding aliases for: $*"
# Removing add empty lines and the last trailing newline if any, and adding a trailing newline.
grep -vE "^\s*$" "/root/sources/assets/shells/aliases.d/$*" | tee -a /opt/.exegol_aliases
}

Also, no statement logic... Please chose one (I personally prefer the first one), and make it easy for devs (like a .vscode config)

if [[ -n $listening_processes ]]; then
echo "Listening processes detected"
ss -lnpt
echo "Kill processes"
# shellcheck disable=SC2086
kill -9 $listening_processes
fi

if [ -d "/root/Desktop" ]; then rm -r /root/Desktop; fi

if [[ $(uname -m) = 'x86_64' ]]
then
local arch="x64"
elif [[ $(uname -m) = 'aarch64' ]]
then
local arch="aarch64"
else
criticalecho-noexit "This installation function doesn't support architecture $(uname -m)" && return
fi

@skyf0l skyf0l added the enhancement New feature or request label Mar 2, 2025
@skyf0l skyf0l changed the title Please apply some coding standards Please apply some bash coding standards Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant