Monorepo for Aesthetic.Computer aesthetic.computer
at main 51 lines 1.6 kB view raw
1#!/bin/bash 2# Setup VS Code to always launch with remote debugging enabled on Linux 3# Run this script on your Linux host machine (not in the container) 4 5ARGV_FILE="$HOME/.config/Code/User/argv.json" 6 7echo "🩸 Setting up VS Code remote debugging on port 9333..." 8 9mkdir -p "$(dirname "$ARGV_FILE")" 10 11if [ -f "$ARGV_FILE" ] && [ -s "$ARGV_FILE" ]; then 12 if grep -q "remote-debugging-port" "$ARGV_FILE"; then 13 echo "✅ remote-debugging-port already configured in argv.json" 14 cat "$ARGV_FILE" 15 exit 0 16 fi 17 18 cp "$ARGV_FILE" "$ARGV_FILE.backup" 19 echo "📦 Backed up existing argv.json to argv.json.backup" 20 21 python3 -c " 22import json, os 23argv_file = os.path.expanduser('~/.config/Code/User/argv.json') 24with open(argv_file, 'r') as f: 25 lines = [l for l in f.read().split(chr(10)) if not l.strip().startswith('//')] 26try: 27 data = json.loads(chr(10).join(lines)) 28except: 29 data = {} 30data['remote-debugging-port'] = 9333 31with open(argv_file, 'w') as f: 32 json.dump(data, f, indent=2) 33 f.write(chr(10)) 34print('Updated argv.json') 35" 36else 37 echo '{"remote-debugging-port": 9333}' > "$ARGV_FILE" 38 echo "📝 Created new argv.json" 39fi 40 41echo "" 42echo "✅ Done! Your argv.json now contains:" 43cat "$ARGV_FILE" 44echo "" 45echo "🔄 Please restart VS Code for changes to take effect." 46echo "" 47echo "After restart, VS Code will ALWAYS launch with CDP on port 9333." 48echo "Container rebuilds will preserve CDP access - no need to run 'start' again!" 49echo "" 50echo "To verify it's working after restart, run in your container:" 51echo " curl -s http://host.docker.internal:9333/json | head -5"