-
Notifications
You must be signed in to change notification settings - Fork 0
/
fun_dirs.py
48 lines (41 loc) · 1.21 KB
/
fun_dirs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import os
from pathlib import Path
emoji_map = {
"krabby": "📁",
"secret": "🔒",
"venv": "🧪",
"assets": "🖼️",
"docs": "📚",
"sandooo": "🏖️",
"src": "🛠️",
"submodules": "🧩",
"target": "🎯",
"utils": "🛠️",
".cursorignore": "📜",
".cursorrules": "📜",
".env": "📜",
".gitignore": "🙈",
"Cargo.lock": "🔒",
"Cargo.toml": "📦",
"krabby.code-workspace": "🧠",
"README.md": "📄",
"requirements.txt": "📋",
"TODO.md": "✅",
"world-chain-contract-address": "🌐",
}
def get_emoji(name):
return emoji_map.get(name, "📄") # Default to 📄 for unknown files/folders
def print_directory_structure(startpath, level=0):
for root, dirs, files in os.walk(startpath):
if ".git" in dirs:
dirs.remove(".git") # Don't show git directory
path = Path(root)
print(" " * level + f"{get_emoji(path.name)} {path.name}")
level += 1
for file in files:
print(" " * level + f"{get_emoji(file)} {file}")
level -= 1
if level == 0:
break # Only process the top-level directory
# Usage
print_directory_structure(".")