Skip to content

Commit

Permalink
Enforce usage of bash
Browse files Browse the repository at this point in the history
  • Loading branch information
glonlas committed Oct 16, 2022
1 parent 5d71b9b commit bb6d070
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ git clone [email protected]:glonlas/Stable-Diffusion-Apple-Silicon-M1-Install.git

cd Stable-Diffusion-Apple-Silicon-M1-Install

./install-stable-diffusion-apple-silicon.sh
bash ./install-stable-diffusion-apple-silicon.sh
```

Option 2: Download offline copy of this repo
```bash
curl https://raw.githubusercontent.com/glonlas/Stable-Diffusion-Apple-Silicon-M1-Install/main/install-stable-diffusion-apple-silicon.sh -o install-stable-diffusion-apple-silicon.sh

./install-stable-diffusion-apple-silicon.sh
bash ./install-stable-diffusion-apple-silicon.sh
```

## How to use it?
Expand Down
15 changes: 15 additions & 0 deletions install-stable-diffusion-apple-silicon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ RESET="\033[0m\033[39m"
# -- FUNCTIONS -----------------------------------------------------------------------------------
STABLE_DIFFUSION_IS_INSTALLED=1

function check_interpreter(){
INTERPRETER=$(ps -p $$ | tail -1 | awk '{print $4}')
if [[ $INTERPRETER != "/bin/bash" ]]; then
echo "ERROR: Wrong interpreter used"
echo "This script needs to be executed with bash to work."
echo "Instead you are using $INTERPRETER."
echo ""
echo "Execute the script with the command:"
echo "bash ./install-stable-diffusion-apple-silicon.sh"
exit 1
fi
}

function check_OS() {
if [[ "$OSTYPE" == "darwin"* ]]; then
if [[ $(uname -m) != 'arm64' ]]; then
Expand Down Expand Up @@ -355,6 +368,8 @@ function upscale_picture() {

# -- MAIN -----------------------------------------------------------------------------------------
function main() {
check_interpreter

echo ""
echo ""
echo "+-----------------------------------------+"
Expand Down

0 comments on commit bb6d070

Please sign in to comment.