1
0
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:
Juan Batiz-Benet
2014-12-09 02:20:48 -08:00
parent dc9f1c4532
commit a9da519715

View File

@ -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