Spaces:
Sleeping
Sleeping
| # Function to export requirements using Poetry | |
| export_requirements() { | |
| poetry export --without-hashes --format=requirements.txt --output=requirements.txt | |
| } | |
| # Function to fetch the Python .gitignore file | |
| fetch_python_gitignore() { | |
| echo "Fetching the Python .gitignore file..." | |
| # Using curl to download the Python .gitignore file | |
| curl -o .gitignore https://raw.githubusercontent.com/github/gitignore/main/Python.gitignore | |
| if [ $? -eq 0 ]; then | |
| echo "Python .gitignore file fetched successfully." | |
| else | |
| echo "Failed to fetch the Python .gitignore file." | |
| fi | |
| } | |
| # Main function | |
| main() { | |
| echo "Choose an option:" | |
| echo "1. Export requirements using Poetry" | |
| echo "2. Fetch Python .gitignore file" | |
| echo "3. Option 3" | |
| echo "4. Option 4" | |
| echo "5. Option 5" | |
| read -p "Enter your choice [1-5]: " choice | |
| case $choice in | |
| 1) | |
| export_requirements | |
| ;; | |
| 2) | |
| fetch_python_gitignore | |
| ;; | |
| 3) | |
| echo "You chose option 3" | |
| # Add your code for option 3 here | |
| ;; | |
| 4) | |
| echo "You chose option 4" | |
| # Add your code for option 4 here | |
| ;; | |
| 5) | |
| echo "You chose option 5" | |
| # Add your code for option 5 here | |
| ;; | |
| *) | |
| echo "Invalid choice. Please enter a number from 1 to 5." | |
| ;; | |
| esac | |
| } | |
| # Call the main function | |
| main | |