mirror of
https://github.com/tj/git-extras.git
synced 2026-09-15 09:56:19 -04:00
git-{clear,clear-soft,sync}: improve yes/no prompts
Don't print trailing newline; prompt for yes/no response on the same line
This commit is contained in:
parent
1ed75978a9
commit
82d6a7265f
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
echo "Sure? - This command may delete files that cannot be recovered, including those in .gitignore [y/N]"
|
||||
echo -n "Sure? - This command may delete files that cannot be recovered, including those in .gitignore [y/N]: "
|
||||
read ans
|
||||
if [ "$ans" == "y" ]
|
||||
then git clean -d -f -x && git reset --hard
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
echo "Sure? - This command may delete files that cannot be recovered. Files and directories in .gitignore will be preserved [Y/n]"
|
||||
echo -n "Sure? - This command may delete files that cannot be recovered. Files and directories in .gitignore will be preserved [Y/n]: "
|
||||
read ans
|
||||
if [ "$ans" != "n" ]
|
||||
then git clean -d -f && git reset --hard
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ function main()
|
|||
remote_branch="${remote}/${branch}"
|
||||
fi
|
||||
|
||||
echo "Are you sure you want to clean all changes & sync with '${remote_branch}'? [y/N]"
|
||||
echo -n "Are you sure you want to clean all changes & sync with '${remote_branch}'? [y/N]: "
|
||||
local res
|
||||
read res
|
||||
case "${res}" in
|
||||
|
|
|
|||
Loading…
Reference in a new issue