From 1d91e7c34907c0837cc766aeab006841d107b8cf Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Sat, 4 Feb 2023 16:32:27 -0300 Subject: [PATCH] Combine "if", and "then" on a single line --- bin/portzap | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/bin/portzap b/bin/portzap index 187fea4..9531b89 100755 --- a/bin/portzap +++ b/bin/portzap @@ -53,8 +53,7 @@ help() { } init() { - if user_is_not_root; - then + if user_is_not_root; then echo "The init command should be run as root." exit 1 fi; @@ -64,10 +63,8 @@ init() { } clone() { - if has_portzap_access; - then - if [ -e "$portzap_dir/.git" ]; - then + if has_portzap_access; then + if [ -e "$portzap_dir/.git" ]; then echo "$portzap_dir has already been cloned." echo "Run 'portzap pull' instead." exit 1 @@ -80,10 +77,8 @@ clone() { } pull() { - if has_portzap_access; - then - if [ -e "$portzap_dir/.git" ]; - then + if has_portzap_access; then + if [ -e "$portzap_dir/.git" ]; then umask $pull_mask cd $portzap_dir git pull --rebase origin hardenedbsd/main @@ -98,8 +93,7 @@ pull() { } install() { - if user_is_not_root; - then + if user_is_not_root; then echo "The install command should be run as root." exit 1 fi