forked from volaradlp/minercli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Volara
committed
Jul 27, 2024
1 parent
922e851
commit 1d566d1
Showing
4 changed files
with
30 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,39 @@ | ||
#!/bin/bash | ||
|
||
# Function to check if a command exists | ||
command_exists() { | ||
command -v "$1" >/dev/null 2>&1 | ||
} | ||
|
||
# Check if Python is installed | ||
if ! command_exists python3; then | ||
echo "Python 3 is not installed. Please install Python 3 and try again." | ||
exit 1 | ||
fi | ||
|
||
# Check if Poetry is installed | ||
if ! command_exists poetry; then | ||
echo "Poetry is not installed. Installing Poetry..." | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
fi | ||
|
||
# Install dependencies using Poetry | ||
echo "Installing dependencies..." | ||
poetry install | ||
|
||
# Get the absolute directory of this script | ||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
|
||
# Add the bin directory to PATH in both .zshrc and .bashrc | ||
echo "export PATH=$SCRIPT_DIR/bin:\$PATH" >> ~/.zshrc | ||
|
||
echo "export PATH=$SCRIPT_DIR/bin:\$PATH" >> ~/.bashrc | ||
|
||
# Update current session's PATH | ||
export PATH=$SCRIPT_DIR/bin:$PATH | ||
|
||
echo 'Volara setup successful.' | ||
# Inform success | ||
GREEN='\033[0;32m' | ||
NC='\033[0m' # No Color | ||
printf "${GREEN}### Volara setup successful ###${NC}\n" | ||
echo 'Please restart your terminal or run 'source ~/.zshrc' or 'source ~/.bashrc' to use the 'volara' command.' | ||
echo 'Start mining with `./bin/volara mine start`' |