-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.ps1
More file actions
103 lines (88 loc) · 3.16 KB
/
Copy pathinstall.ps1
File metadata and controls
103 lines (88 loc) · 3.16 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# grugbot420 Windows Installer
# One-click install. No complexity.
#
# Usage:
# irm https://grug.sh/install | iex
# or
# .\install.ps1
$ErrorActionPreference = "Stop"
Write-Host ""
Write-Host " 🦴 grugbot420 Installer" -ForegroundColor Green
Write-Host " ========================" -ForegroundColor Green
Write-Host ""
# Check if Bun is installed
$bunPath = Get-Command bun -ErrorAction SilentlyContinue
if (-not $bunPath) {
Write-Host " 📦 Installing Bun..." -ForegroundColor Yellow
# Install Bun
try {
powershell -c "irm bun.sh/install.ps1 | iex"
# Refresh PATH
$env:BUN_INSTALL = "$env:USERPROFILE\.bun"
$env:PATH = "$env:BUN_INSTALL\bin;$env:PATH"
Write-Host " ✅ Bun installed!" -ForegroundColor Green
} catch {
Write-Host " ❌ Failed to install Bun. Try manually: irm bun.sh/install.ps1 | iex" -ForegroundColor Red
exit 1
}
} else {
Write-Host " ✅ Bun already installed" -ForegroundColor Green
}
# Create grug directory
$grugDir = "$env:USERPROFILE\.grug"
if (-not (Test-Path $grugDir)) {
New-Item -ItemType Directory -Path $grugDir | Out-Null
}
Write-Host " 📥 Downloading grugbot-server..." -ForegroundColor Yellow
# Clone or update repo
$repoDir = "$grugDir\grugbot-server"
if (Test-Path $repoDir) {
Set-Location $repoDir
git pull --quiet
Write-Host " ✅ Updated grugbot-server" -ForegroundColor Green
} else {
git clone --quiet https://github.com/grug-group420/grugbot-server.git $repoDir
Write-Host " ✅ Downloaded grugbot-server" -ForegroundColor Green
}
# Create desktop shortcut
$shortcutPath = "$env:USERPROFILE\Desktop\grugbot420.lnk"
$WshShell = New-Object -ComObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut($shortcutPath)
$Shortcut.TargetPath = "cmd.exe"
$Shortcut.Arguments = "/c cd /d `"$repoDir`" && bun run serve && pause"
$Shortcut.WorkingDirectory = $repoDir
$Shortcut.Description = "Start grugbot420 server"
$Shortcut.Save()
Write-Host " ✅ Created desktop shortcut" -ForegroundColor Green
# Create start script
$startScript = @"
@echo off
cd /d "$repoDir"
echo.
echo 🤖 Starting grugbot420...
echo Open http://localhost:3420 in your browser
echo.
bun run serve
pause
"@
$startScript | Out-File -FilePath "$grugDir\start-grug.bat" -Encoding ASCII
Write-Host ""
Write-Host " ========================================" -ForegroundColor Green
Write-Host " 🎉 grugbot420 installed!" -ForegroundColor Green
Write-Host " ========================================" -ForegroundColor Green
Write-Host ""
Write-Host " To start:" -ForegroundColor Cyan
Write-Host " • Double-click 'grugbot420' on your desktop" -ForegroundColor White
Write-Host " • Or run: cd ~/.grug/grugbot-server && bun run serve" -ForegroundColor White
Write-Host ""
Write-Host " Then open: http://localhost:3420" -ForegroundColor Cyan
Write-Host ""
Write-Host " 🦴 Complexity is the enemy. Ship code." -ForegroundColor DarkGray
Write-Host ""
# Ask to start now
$response = Read-Host " Start grugbot420 now? (Y/n)"
if ($response -ne "n" -and $response -ne "N") {
Set-Location $repoDir
Start-Process "http://localhost:3420"
bun run serve
}