Skip to content

Commit 541a784

Browse files
fixed small bug with the read command
1 parent b1de3a3 commit 541a784

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

basics/git_add.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ for i in "${!files[@]}"; do
2020
done
2121

2222
# Ask user to pick a file
23-
read -p "Select the file number you want to upload: " choice
23+
read -r -p "Select the file number you want to upload: " choice
2424

2525
# Validate input
2626
if ! [[ "$choice" =~ ^[0-9]+$ ]] || (( choice < 1 || choice > ${#files[@]} )); then
@@ -31,7 +31,7 @@ fi
3131
filename="${files[$((choice-1))]}"
3232

3333
# Ask for commit message
34-
read -p "Enter commit message: " commit_msg
34+
read -r -p "Enter commit message: " commit_msg
3535

3636
# Detect current branch automatically
3737
branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)

0 commit comments

Comments
 (0)