Monorepo for Aesthetic.Computer
aesthetic.computer
1#!/usr/bin/env bash
2
3# Ensure ~/.local/bin is in PATH
4export PATH="$HOME/.local/bin:$PATH"
5
6# Use a writable XDG config root so fish can create its state files
7# Detect if we're in a devcontainer or on macOS
8if [ -d "/workspaces/aesthetic-computer" ]; then
9 # Devcontainer environment
10 if [ -z "$XDG_CONFIG_HOME" ]; then
11 export XDG_CONFIG_HOME="/workspaces/aesthetic-computer/.xdg"
12 fi
13 mkdir -p "$XDG_CONFIG_HOME/fish/functions"
14
15 FISH_CONFIG_FILE="$XDG_CONFIG_HOME/fish/config.fish"
16 if [ ! -f "$FISH_CONFIG_FILE" ]; then
17 cat <<'EOF' > "$FISH_CONFIG_FILE"
18source /workspaces/aesthetic-computer/.devcontainer/config.fish
19EOF
20 fi
21else
22 # macOS/local environment - use existing fish config
23 if [ -z "$XDG_CONFIG_HOME" ]; then
24 export XDG_CONFIG_HOME="$HOME/.config"
25 fi
26fi
27
28echo "→ \$0 is: $0"
29echo "→ SHELL is: $SHELL"
30echo "→ USER is: $USER"
31echo "→ HOME is: $HOME"
32echo "→ PATH is: $PATH"
33echo "→ Current directory: $(pwd)"
34
35# if command -v docker >/dev/null; then
36# echo "✅ Found 'docker' in PATH"
37# else
38# echo "❌ 'docker' not found in PATH"
39# fi
40
41# Detect Fish shell
42if [[ "$SHELL" == *fish* ]]; then
43 echo "🐟 Detected Fish shell"
44 echo "🎬 Launching 'aesthetic' via Fish (login shell)"
45 # Set marker so config.fish knows to auto-run aesthetic
46 export AC_TASK_LAUNCH=1
47 exec fish --login
48else
49 echo "🐚 Detected non-Fish shell"
50 if command -v aesthetic > /dev/null; then
51 echo "🎬 Launching 'aesthetic'"
52 exec aesthetic
53 elif command -v docker > /dev/null; then
54 echo "🧹 Pruning Docker system"
55 docker system prune -f
56 fi
57 clear
58 echo -e "\n\033[1m 🟪 Please run the Aesthetic Platform from its development container.\033[0m\n"
59fi