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