penguin/utils

my env utils

commit f69c09a37d7d4e2b21cb940a7839db2081cbf100

author斟酌 鵬兄 <tgckpg@gmail.com>
date2024-07-11T15:14:55Z
subjectDo not ask to save password for unsupported os
commit f69c09a37d7d4e2b21cb940a7839db2081cbf100
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date:   2024-07-11T15:14:55Z

    Do not ask to save password for unsupported os
---
 bash/sources/16_keystore | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/bash/sources/16_keystore b/bash/sources/16_keystore
index 3d3c223..752cee1 100644
--- a/bash/sources/16_keystore
+++ b/bash/sources/16_keystore
@@ -219,12 +219,15 @@ function _kstoresecret-config {
 			return 1
 		fi
 
-		read -p "Save this password to OS's keystore? (y/n): " _CONFIRM
-		if [ "$_CONFIRM" != "y" ]; then
-			return 0
-		fi
-
-		_kstoresecret-auto set
+		case $OSTYPE in
+			cygwin|darwin*)
+				read -p "Save this password to OS's keystore? (y/n): " _CONFIRM
+				if [ "$_CONFIRM" != "y" ]; then
+					return 0
+				fi
+				_kstoresecret-auto set
+			;;
+		esac
 	fi
 }