Repository navigation
Expand file tree
/
Copy pathreset.sh
More file actions
executable file
·67 lines (59 loc) · 3.11 KB
/
Copy pathreset.sh
File metadata and controls
executable file
·67 lines (59 loc) · 3.11 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env bash
# =============================================================================
# reset.sh
# Resets the workspace between attendees at the booth.
# Kills any running Streamlit process, wipes app.py, and creates a fresh one.
# Usage: ./reset.sh
# =============================================================================
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
APP_FILE="${SCRIPT_DIR}/app.py"
echo ""
echo "╔══════════════════════════════════════════════════════╗"
echo "║ 🔄 Vibe Coding 2.0 — Resetting Workspace ║"
echo "╚══════════════════════════════════════════════════════╝"
echo ""
# ---------------------------------------------------------------------------
# 1. Kill any running Streamlit process
# ---------------------------------------------------------------------------
echo "▶ Stopping Streamlit (if running)..."
if pkill -f "streamlit run" 2>/dev/null; then
echo " ✅ Streamlit process stopped"
else
echo " ℹ️ No running Streamlit process found"
fi
echo ""
# ---------------------------------------------------------------------------
# 2. Short pause to ensure the port is released
# ---------------------------------------------------------------------------
sleep 1
# ---------------------------------------------------------------------------
# 3. Remove and recreate app.py
# ---------------------------------------------------------------------------
echo "▶ Resetting app.py..."
if [ -f "${APP_FILE}" ]; then
rm "${APP_FILE}"
echo " 🗑️ Old app.py deleted"
fi
touch "${APP_FILE}"
echo " ✅ Fresh empty app.py created at ${APP_FILE}"
echo ""
# ---------------------------------------------------------------------------
# 4. (Optional) Clear __pycache__ to avoid stale compiled files
# ---------------------------------------------------------------------------
if [ -d "${SCRIPT_DIR}/__pycache__" ]; then
rm -rf "${SCRIPT_DIR}/__pycache__"
echo " 🗑️ __pycache__ cleared"
fi
# ---------------------------------------------------------------------------
# Done!
# ---------------------------------------------------------------------------
echo "╔══════════════════════════════════════════════════════╗"
echo "║ ✅ Workspace reset! Ready for next attendee 🎉 ║"
echo "║ ║"
echo "║ Next steps: ║"
echo "║ 1. Hand the keyboard to the new attendee ║"
echo "║ 2. Run: /vibe-coding ║"
echo "║ 3. Let the vibes flow 🚀 ║"
echo "╚══════════════════════════════════════════════════════╝"
echo ""