Skip to content

Commit

Permalink
Add files
Browse files Browse the repository at this point in the history
  • Loading branch information
anhkhoakz committed Jan 25, 2024
1 parent 422ad08 commit 7464825
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,11 @@
#!/bin/bash

has_pip() {
command -v pip >/dev/null 2>&1
install_dependency() {
pip show "$1" >/dev/null 2>&1 || pip install "$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'
}
command -v pip >/dev/null 2>&1 || { echo "pip is not installed"; return; }

install_dependencies
install_dependency 'requests'
install_dependency 'qrcode'
install_dependency 'Pillow'

0 comments on commit 7464825

Please sign in to comment.