Skip to content

Commit 77b7c7b

Browse files
Address review feedback: skip prompt but keep install_profile call
- Changed "Installed mandatory profile" to "Installed profile" on line 119 - Removed continue statement on line 98 that was skipping install_profile - Now only skips the user prompt for already-installed optional profiles - install_profile is still called for all profiles (mandatory and already-installed optional) Co-authored-by: HectorCastelli <3715874+HectorCastelli@users.noreply.github.com>
1 parent f007d1d commit 77b7c7b

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

scripts/get.sh

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,29 +93,32 @@ install() {
9393
PROFILES=$("$DOTFILES_DIR/scripts/profiles.sh" list)
9494
for profile in $PROFILES; do
9595
# Check if profile is already installed
96+
already_installed=0
9697
if grep -qxF "$profile" "$TARGET_DIR/.dotfiles_profiles" 2>/dev/null; then
98+
already_installed=1
9799
printf "Profile '%s' is already installed.\n" "$profile"
98-
continue
99100
fi
100101

101102
if [ ! -f "$DOTFILES_DIR/profiles/$profile/.mandatory" ]; then
102-
printf "Optional profile available: %s\n" "$profile"
103-
printf "Would you like to install '%s'? [y/N]: " "$profile"
104-
read -r ans </dev/tty
105-
case "$(printf '%s' "$ans" | tr '[:upper:]' '[:lower:]')" in
106-
y | yes) ;;
107-
*)
108-
printf "Skipped optional profile: %s\n" "$profile"
109-
continue
110-
;;
111-
esac
103+
if [ "$already_installed" -eq 0 ]; then
104+
printf "Optional profile available: %s\n" "$profile"
105+
printf "Would you like to install '%s'? [y/N]: " "$profile"
106+
read -r ans </dev/tty
107+
case "$(printf '%s' "$ans" | tr '[:upper:]' '[:lower:]')" in
108+
y | yes) ;;
109+
*)
110+
printf "Skipped optional profile: %s\n" "$profile"
111+
continue
112+
;;
113+
esac
114+
fi
112115
else
113116
printf "Profile '%s' is mandatory.\n" "$profile"
114117
fi
115118
if sh "$DOTFILES_DIR/scripts/target.sh" install_profile "$profile"; then
116-
printf "Installed mandatory profile: %s\n" "$profile"
119+
printf "Installed profile: %s\n" "$profile"
117120
else
118-
printf "Error: failed to install mandatory profile '%s'.\n" "$profile"
121+
printf "Error: failed to install profile '%s'.\n" "$profile"
119122
return 2
120123
fi
121124
done

0 commit comments

Comments
 (0)