Skip to content

Commit a7a11c0

Browse files
authored
chore: small changes to Linux script (#90)
1 parent 3b5b032 commit a7a11c0

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

scripts/install.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,10 @@ detect_shell_rc() {
321321
add_updater_alias() {
322322
local shell_rc
323323
shell_rc=$(detect_shell_rc)
324-
local alias_line="alias dartotsu-updater='bash <(curl -s https://raw.githubusercontent.com/aayush2622/Dartotsu/main/scripts/install.sh)'"
324+
local alias_line="alias dartotsu-updater='bash <(curl -s https://raw.githubusercontent.com/aayush2622/Dartotsu/main/scripts/install.sh) update'"
325325

326326
if grep -Fxq "$alias_line" "$shell_rc" 2>/dev/null; then
327-
echo -ne "${YELLOW}${ICON_WARNING}${RESET} Alias already exists in $(basename "$shell_rc"). Do you want to remove it? [y/N]: "
327+
echo -ne "${YELLOW}${ICON_WARNING}${RESET} The 'dartotsu-updater' alias already exists in your shell config file ($(basename "$shell_rc")). Would you like to remove it? [y/N]: "
328328
read -r remove_response
329329
case "$remove_response" in
330330
[yY][eE][sS]|[yY])
@@ -336,7 +336,7 @@ add_updater_alias() {
336336
;;
337337
esac
338338
else
339-
echo -ne "${CYAN}${ICON_MAGIC}${RESET} Do you want to add the 'dartotsu-updater' alias to $(basename "$shell_rc")? [y/N]: "
339+
echo -ne "${CYAN}${ICON_MAGIC}${RESET} Would you like to add the 'dartotsu-updater' alias to your shell config file ($(basename "$shell_rc"))? [y/N]: "
340340
read -r add_response
341341
case "$add_response" in
342342
[yY][eE][sS]|[yY])
@@ -831,9 +831,7 @@ main_loop() {
831831
}
832832

833833
# Check if running in interactive mode
834-
if [ -t 0 ]; then
835-
main_loop
836-
else
834+
if [ $# -gt 0 ]; then
837835
# Non-interactive mode - handle command line arguments
838836
ACTION="$1"
839837
case "${ACTION,,}" in
@@ -856,4 +854,10 @@ else
856854
exit 1
857855
;;
858856
esac
857+
elif [ -t 0 ]; then
858+
# Interactive mode - show menu
859+
main_loop
860+
else
861+
# Fallback to interactive mode
862+
main_loop
859863
fi

0 commit comments

Comments
 (0)