feat: git_gpg 增加对 brew 的支持
This commit is contained in:
parent
2797ba09bb
commit
324e4cfcb6
@ -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!"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user