-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request !301 from shenmo/dev
- Loading branch information
Showing
12 changed files
with
112 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Building Program | ||
run-name: Building ${{ GITHUB.REPOSITORY }} | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
call: | ||
uses: GXDE-OS/GXDE/.github/workflows/building-deb.yml@master | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
# We use sudo twice to avoid ACE bug here | ||
# https://gitee.com/amber-ce/amber-ce-bookworm/commit/43e1a1599ede474b37e41aa10c53fd8afc4d35a1 | ||
|
||
function zenity() { | ||
if [[ -e /usr/bin/garma ]]; then | ||
garma "$@" | ||
else | ||
$(command -v zenity) "$@" | ||
fi | ||
} | ||
|
||
|
||
|
||
# 检查sudo是否需要密码 | ||
if sudo sudo -n true 2>/dev/null; then | ||
echo "sudo 无需密码,继续执行" | ||
|
||
else | ||
|
||
# 循环输入密码直到成功或用户取消 | ||
while true; do | ||
# 使用zenity弹出密码输入框 | ||
PASSWORD=$(zenity --password --title="需要sudo权限" ) | ||
|
||
# 检查用户是否取消输入 | ||
if [ -z "$PASSWORD" ]; then | ||
zenity --error --text="操作已取消" | ||
exit 1 | ||
fi | ||
|
||
# 尝试使用输入的密码执行sudo命令 | ||
echo "$PASSWORD" | sudo sudo -S true 2>/dev/null | ||
|
||
# 检查sudo是否成功 | ||
if [ $? -eq 0 ]; then | ||
echo "密码正确,继续执行" | ||
break | ||
else | ||
zenity --error --text="密码错误,请重新输入" | ||
fi | ||
done | ||
fi | ||
|
||
echo "$PASSWORD" | sudo sudo -S "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters