Combine "if", and "then" on a single line

This commit is contained in:
0x1eef 2023-02-04 16:32:27 -03:00
parent f6e7048c89
commit 1d91e7c349

View file

@ -53,8 +53,7 @@ help() {
} }
init() { init() {
if user_is_not_root; if user_is_not_root; then
then
echo "The init command should be run as root." echo "The init command should be run as root."
exit 1 exit 1
fi; fi;
@ -64,10 +63,8 @@ init() {
} }
clone() { clone() {
if has_portzap_access; if has_portzap_access; then
then if [ -e "$portzap_dir/.git" ]; then
if [ -e "$portzap_dir/.git" ];
then
echo "$portzap_dir has already been cloned." echo "$portzap_dir has already been cloned."
echo "Run 'portzap pull' instead." echo "Run 'portzap pull' instead."
exit 1 exit 1
@ -80,10 +77,8 @@ clone() {
} }
pull() { pull() {
if has_portzap_access; if has_portzap_access; then
then if [ -e "$portzap_dir/.git" ]; then
if [ -e "$portzap_dir/.git" ];
then
umask $pull_mask umask $pull_mask
cd $portzap_dir cd $portzap_dir
git pull --rebase origin hardenedbsd/main git pull --rebase origin hardenedbsd/main
@ -98,8 +93,7 @@ pull() {
} }
install() { install() {
if user_is_not_root; if user_is_not_root; then
then
echo "The install command should be run as root." echo "The install command should be run as root."
exit 1 exit 1
fi fi