Skip to content

Commit

Permalink
Rewrite in Shell
Browse files Browse the repository at this point in the history
  • Loading branch information
anhkhoakz committed Jan 22, 2024
1 parent a089468 commit 727e97e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 47 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ Ensure your system meets the following prerequisites:
2. Install the required packages by running the following command in your terminal or command prompt:

```sh
python3 ./setup.py
chmod +x ./setup.sh
./setup.sh
```

## Usage
Expand Down
46 changes: 0 additions & 46 deletions setup.py

This file was deleted.

24 changes: 24 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

has_pip() {
command -v pip >/dev/null 2>&1
}

check_and_install_dependency() {
if ! pip show "$1" >/dev/null 2>&1; then
pip install "$1"
fi
}

install_dependencies() {
if ! has_pip; then
echo "pip is not installed"
return
fi

check_and_install_dependency 'requests'
check_and_install_dependency 'qrcode'
check_and_install_dependency 'Pillow'
}

install_dependencies

0 comments on commit 727e97e

Please sign in to comment.