You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
775 B
45 lines
775 B
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
echo "📂 Creating Flask BookScraper structure in current directory..."
|
|
|
|
# --- Create folders ---
|
|
mkdir -p scraper
|
|
mkdir -p templates
|
|
mkdir -p static
|
|
|
|
# --- Create empty files ---
|
|
|
|
touch app.py
|
|
|
|
touch scraper/__init__.py
|
|
touch scraper/scraper.py
|
|
touch scraper/sites.py
|
|
touch scraper/utils.py
|
|
|
|
touch templates/index.html
|
|
touch templates/result.html
|
|
|
|
touch static/.keep # empty placeholder to keep folder under git
|
|
|
|
# --- Optional: auto-create requirements file ---
|
|
cat <<EOF > requirements.txt
|
|
flask
|
|
requests
|
|
beautifulsoup4
|
|
lxml
|
|
pillow
|
|
EOF
|
|
|
|
echo "🎉 Structure created successfully!"
|
|
|
|
# Show structure
|
|
echo
|
|
if command -v tree >/dev/null 2>&1; then
|
|
tree .
|
|
else
|
|
echo "Install 'tree' for pretty output. Current structure:"
|
|
ls -R .
|
|
fi
|