|
| 1 | +#!/bin/sh |
| 2 | + |
| 3 | +install_ssh_config() { |
| 4 | +echo"🔑 Installing SSH configuration..." |
| 5 | +rsync -a /mnt/home/coder/.ssh/~/.ssh/ |
| 6 | +chmod 0700~/.ssh |
| 7 | +} |
| 8 | + |
| 9 | +install_git_config() { |
| 10 | +echo"📂 Installing Git configuration..." |
| 11 | +if [-f /mnt/home/coder/git/config ];then |
| 12 | +rsync -a /mnt/home/coder/git/~/.config/git/ |
| 13 | +elif [-d /mnt/home/coder/.gitconfig ];then |
| 14 | +rsync -a /mnt/home/coder/.gitconfig~/.gitconfig |
| 15 | +else |
| 16 | +echo"⚠️ Git configuration directory not found." |
| 17 | +fi |
| 18 | +} |
| 19 | + |
| 20 | +install_dotfiles() { |
| 21 | +if [!-d /mnt/home/coder/.config/coderv2/dotfiles ];then |
| 22 | +echo"⚠️ Dotfiles directory not found." |
| 23 | +return |
| 24 | +fi |
| 25 | + |
| 26 | +cd /mnt/home/coder/.config/coderv2/dotfiles||return |
| 27 | +forscriptin install.sh install bootstrap.sh bootstrap script/bootstrap setup.sh setup script/setup;do |
| 28 | +if [-x$script ];then |
| 29 | +echo"📦 Installing dotfiles..." |
| 30 | +./$script|| { |
| 31 | +echo"❌ Error running$script. Please check the script for issues." |
| 32 | +return |
| 33 | +} |
| 34 | +echo"✅ Dotfiles installed successfully." |
| 35 | +return |
| 36 | +fi |
| 37 | +done |
| 38 | +echo"⚠️ No install script found in dotfiles directory." |
| 39 | +} |
| 40 | + |
| 41 | +personalize() { |
| 42 | +# Allow script to continue as Coder dogfood utilizes a hack to |
| 43 | +# synchronize startup script execution. |
| 44 | +touch /tmp/.coder-startup-script.done |
| 45 | + |
| 46 | +if [-x /mnt/home/coder/personalize ];then |
| 47 | +echo"🎨 Personalizing environment..." |
| 48 | +/mnt/home/coder/personalize |
| 49 | +fi |
| 50 | +} |
| 51 | + |
| 52 | +install_ssh_config |
| 53 | +install_dotfiles |
| 54 | +personalize |