From 324e4cfcb6afa5a0d7bbffd6a61b52df68ab81ed Mon Sep 17 00:00:00 2001 From: Konano Date: Fri, 31 Jan 2025 22:46:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20git=5Fgpg=20=E5=A2=9E=E5=8A=A0=E5=AF=B9?= =?UTF-8?q?=20brew=20=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configure_priv.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/configure_priv.sh b/configure_priv.sh index e3dd908..65d72cb 100755 --- a/configure_priv.sh +++ b/configure_priv.sh @@ -484,12 +484,19 @@ configure_git_gpg() { [ -n "$(git config --global user.signingkey)" ] && return if confirm_action "要配置 git 使用 gpg 签名吗?" "N"; then - if ! command_exists 7za; then - sudo apt install p7zip-full -y + if [ "$(uname)" = "Darwin" ]; then + if ! command_exists 7z; then + brew install p7zip + fi + else + if ! command_exists 7za; then + sudo apt install p7zip-full -y + alias 7z=7za + fi fi read_password cp $scriptdir/files/git.key.zip $tempdir/git.key.zip - 7za x -p$password $tempdir/git.key.zip -o$tempdir > /dev/null 2>&1 + 7z x -p$password $tempdir/git.key.zip -o$tempdir > /dev/null 2>&1 rm $tempdir/git.key.zip if [ ! -s $tempdir/git.key ]; then echo "Wrong password!"