mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-27 07:57:30 +08:00
test/countineyn terminal and error code
This commit is contained in:
@ -2,9 +2,12 @@
|
||||
# Author: Juan Batiz-Benet <juan@benet.ai>
|
||||
# MIT LICENSED
|
||||
|
||||
# if not a terminal, exit 0 (yes!)
|
||||
test -t 1 || exit 0
|
||||
|
||||
read -p "continue? [y/N] "
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
if [[ $REPLY =~ ^[Yy] ]]; then
|
||||
exit 0
|
||||
fi
|
||||
exit -1
|
||||
exit 1
|
||||
|
Reference in New Issue
Block a user