Skip to content

Commit

Permalink
更新文件
Browse files Browse the repository at this point in the history
  • Loading branch information
sinspired committed Nov 13, 2024
1 parent 9904d0c commit 5c4079a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update_hosts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
python -V
which python
echo "Running script with sudo..."
sudo python SetHosts.py --verbose
sudo python SetHosts.py --no-input
- name: Commit and push changes
env:
Expand Down
6 changes: 5 additions & 1 deletion SetHosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ def parse_args():
action="store_true",
help="打印运行信息",
)
parser.add_argument(
"--no-input", action="store_true", help="Run without waiting for user input"
)
return parser.parse_args()


Expand Down Expand Up @@ -1172,7 +1175,8 @@ async def main():
rprint(
f"[bold]代码运行时间:[/bold] [cyan]{total_time.total_seconds():.2f} 秒[/cyan]"
)
input("\n任务执行完毕,按任意键退出!")
if not args.no_input:
input("\n任务执行完毕,按任意键退出!")


if __name__ == "__main__":
Expand Down

0 comments on commit 5c4079a

Please sign in to comment.