Update some vars. Switch to podman
This commit is contained in:
@@ -1,21 +1,22 @@
|
|||||||
|
networks:
|
||||||
|
nginx-bridge:
|
||||||
|
external: true
|
||||||
|
|
||||||
services:
|
services:
|
||||||
bang-web-server:
|
bang:
|
||||||
build:
|
build:
|
||||||
context: ../
|
context: ../
|
||||||
dockerfile: docker/Dockerfile
|
dockerfile: docker/Dockerfile
|
||||||
|
image: gib/bang:latest
|
||||||
container_name: bang
|
container_name: bang
|
||||||
hostname: bang.gib
|
hostname: bang
|
||||||
domainname: bang.gbrown.org
|
domainname: bang.gbrown.org
|
||||||
networks:
|
networks:
|
||||||
- nginx-bridge
|
- nginx-bridge
|
||||||
#ports:
|
#ports: ['5000:5000']
|
||||||
#- 5000:5000
|
stdin_open: true
|
||||||
tty: true
|
tty: true
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- ../:/app
|
- ../:/app
|
||||||
command: serve -s /app/dist -l 5000
|
command: serve -s /app/dist -l 5000
|
||||||
|
|
||||||
networks:
|
|
||||||
nginx-bridge:
|
|
||||||
external: true
|
|
@@ -47,5 +47,5 @@ fi
|
|||||||
pnpm install
|
pnpm install
|
||||||
pnpm build
|
pnpm build
|
||||||
cd docker || exit 1
|
cd docker || exit 1
|
||||||
sudo docker compose up -d
|
sudo podman compose up -d
|
||||||
cd ..
|
cd ..
|
||||||
|
@@ -47,6 +47,6 @@ fi
|
|||||||
git pull
|
git pull
|
||||||
pnpm build
|
pnpm build
|
||||||
cd docker || exit 1
|
cd docker || exit 1
|
||||||
sudo docker compose down
|
sudo podman compose down
|
||||||
sudo docker compose up -d
|
sudo podman compose up -d
|
||||||
cd ..
|
cd ..
|
||||||
|
1576
pnpm-lock.yaml
generated
1576
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,98 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
import argparse
|
|
||||||
from pathlib import Path
|
|
||||||
import pyperclip
|
|
||||||
import questionary
|
|
||||||
|
|
||||||
# List of directories to exclude
|
|
||||||
EXCLUDED_DIRS = {'node_modules', '.next', '.venv', '.git', '__pycache__', '.idea', '.vscode', 'ui'}
|
|
||||||
|
|
||||||
def collect_files(project_path):
|
|
||||||
"""
|
|
||||||
Collects files from the project directory, excluding specified directories and filtering by extensions.
|
|
||||||
Returns a list of file paths relative to the project directory.
|
|
||||||
"""
|
|
||||||
collected_files = []
|
|
||||||
|
|
||||||
for root, dirs, files in os.walk(project_path):
|
|
||||||
# Exclude specified directories
|
|
||||||
dirs[:] = [d for d in dirs if d not in EXCLUDED_DIRS]
|
|
||||||
|
|
||||||
for file in files:
|
|
||||||
file_path = Path(root) / file
|
|
||||||
relative_path = file_path.relative_to(project_path)
|
|
||||||
collected_files.append(relative_path)
|
|
||||||
|
|
||||||
return collected_files
|
|
||||||
|
|
||||||
def main():
|
|
||||||
# Parse command-line arguments
|
|
||||||
parser = argparse.ArgumentParser(description='Generate Markdown from selected files.')
|
|
||||||
parser.add_argument('path', nargs='?', default='.', help='Path to the project directory')
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
project_path = Path(args.path).resolve()
|
|
||||||
if not project_path.is_dir():
|
|
||||||
print(f"Error: '{project_path}' is not a directory.")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
# Collect files from the project directory
|
|
||||||
file_list = collect_files(project_path)
|
|
||||||
|
|
||||||
if not file_list:
|
|
||||||
print("No files found in the project directory with the specified extensions.")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
# Sort file_list for better organization
|
|
||||||
file_list.sort()
|
|
||||||
|
|
||||||
# Interactive file selection using questionary
|
|
||||||
print("\nSelect the files you want to include:")
|
|
||||||
selected_files = questionary.checkbox(
|
|
||||||
"Press space to select files, and Enter when you're done:",
|
|
||||||
choices=[str(f) for f in file_list]
|
|
||||||
).ask()
|
|
||||||
|
|
||||||
if not selected_files:
|
|
||||||
print("No files selected.")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
# Generate markdown
|
|
||||||
markdown_lines = []
|
|
||||||
markdown_lines.append('')
|
|
||||||
|
|
||||||
for selected_file in selected_files:
|
|
||||||
file_path = project_path / selected_file
|
|
||||||
try:
|
|
||||||
with open(file_path, 'r', encoding='utf-8') as f:
|
|
||||||
content = f.read()
|
|
||||||
# Determine the language for code block from file extension
|
|
||||||
language = file_path.suffix.lstrip('.')
|
|
||||||
markdown_lines.append(f'{selected_file}')
|
|
||||||
markdown_lines.append(f'```{language}')
|
|
||||||
markdown_lines.append(content)
|
|
||||||
markdown_lines.append('```')
|
|
||||||
markdown_lines.append('')
|
|
||||||
except Exception as e:
|
|
||||||
print(f"Error reading file {selected_file}: {e}")
|
|
||||||
|
|
||||||
# Copy markdown content to clipboard
|
|
||||||
markdown_text = '\n'.join(markdown_lines)
|
|
||||||
pyperclip.copy(markdown_text)
|
|
||||||
print("Markdown content has been copied to the clipboard.")
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
# Check if required libraries are installed
|
|
||||||
try:
|
|
||||||
import questionary
|
|
||||||
import pyperclip
|
|
||||||
except ImportError as e:
|
|
||||||
missing_module = e.name
|
|
||||||
print(f"Error: Missing required module '{missing_module}'.")
|
|
||||||
print(f"Please install it by running: pip install {missing_module}")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
main()
|
|
Reference in New Issue
Block a user