Skip to content

Commit

Permalink
feat: capture error
Browse files Browse the repository at this point in the history
  • Loading branch information
wy-luke committed Aug 22, 2023
1 parent f9c314a commit 17901fd
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions sd-installer.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
#! /bin/bash

echo "开始安装 Stable Diffusion WebUI"
echo "如果失败请重试"
echo "开始安装 Stable Diffusion web UI ......"

# Define a function to handle errors
function handle_error {
echo "An error occurred"
read -p "Do you want to retry? [y/n] " choice
if [[ $choice == [yY] ]]; then
# Retry the command
$last_command
else
# Exit the script
exit 1
fi
}
# Set the error handler
trap 'handle_error' ERR

echo "############ Check and install Homebrew ##############"
# Homebrew: The missing package manager for macOS
Expand Down

0 comments on commit 17901fd

Please sign in to comment.