Monorepo for Aesthetic.Computer aesthetic.computer
at main 60 lines 2.1 kB view raw
1#!/usr/bin/env bash 2 3# Start the Aesthetic Computer devcontainer and open VS Code connected to it. 4# 5# Prerequisites: 6# npm install -g @devcontainers/cli 7# 8# This script: 9# 1. Builds the devcontainer if needed 10# 2. Opens VS Code connected to the devcontainer 11 12set -e 13 14SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 15cd "$SCRIPT_DIR" 16 17# Colors 18GREEN='\033[0;32m' 19YELLOW='\033[1;33m' 20BLUE='\033[0;34m' 21MAGENTA='\033[0;35m' 22NC='\033[0m' # No Color 23 24echo -e "${MAGENTA}" 25echo "╔══════════════════════════════════════════════════════════════╗" 26echo "║ 🎨 Aesthetic Computer - Devcontainer Mode ║" 27echo "╚══════════════════════════════════════════════════════════════╝" 28echo -e "${NC}" 29 30# Check if devcontainer CLI is installed 31if ! command -v devcontainer &> /dev/null; then 32 echo -e "${YELLOW}⚠️ devcontainer CLI not found. Installing...${NC}" 33 npm install -g @devcontainers/cli 34fi 35 36echo -e "${BLUE}📦 Checking devcontainer CLI version...${NC}" 37devcontainer --version 38 39# Check if Docker is running 40if ! docker info &> /dev/null; then 41 echo -e "${YELLOW}⚠️ Docker doesn't seem to be running. Please start Docker Desktop.${NC}" 42 exit 1 43fi 44 45echo -e "${GREEN}✅ Docker is running${NC}" 46 47# Open VS Code connected to the devcontainer (builds if needed) 48echo -e "${BLUE}🚀 Building and starting devcontainer...${NC}" 49echo -e "${YELLOW} (This may take a while on first run to build the container)${NC}" 50 51# First bring up the container 52devcontainer up --workspace-folder "$SCRIPT_DIR" 53 54echo -e "${GREEN}✅ Devcontainer is up!${NC}" 55 56# Now open VS Code attached to it 57echo -e "${BLUE}🚀 Opening VS Code...${NC}" 58code --folder-uri "vscode-remote://dev-container+$(printf '%s' "$SCRIPT_DIR" | xxd -p | tr -d '\n')/workspaces/aesthetic-computer" 59 60echo -e "${GREEN}✅ VS Code launched with devcontainer!${NC}"