Skip to content

Commit

Permalink
limit input to one char
Browse files Browse the repository at this point in the history
- limit input to one char
- consider empty input as positive answer and everything else in negative (except Y/y)
- explicitly inform the creation is canceled
  • Loading branch information
y1n0 committed Jan 21, 2017
1 parent 0f5ba59 commit 4f34a3a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Create-Desktop-Entry
Expand Up @@ -30,10 +30,10 @@ create_desktop_entry() {
}

printf "Create a desktop entry for Popcorn Time for the current user ? (Y)es/(N)o: "
read input
read -n1 input


if [ "$input" == "Y" ] || [ "$input" == "y" ]
if [ "$input" == "Y" ] || [ "$input" == "y" ] || [ "$input" == "" ]
then
case "$(uname)" in
Linux)
Expand All @@ -42,5 +42,5 @@ then
echo "Create a desktop entry is only meant to be used on Linux" ;;
esac
else
echo "Just execute ./Create-Desktop-Entry when you are ready to create a desktop entry for Popcorn Time"
echo -e "Cancel. /nJust execute ./Create-Desktop-Entry when you are ready to create a desktop entry for Popcorn Time"
fi

0 comments on commit 4f34a3a

Please sign in to comment.