-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync_rules.ps1
More file actions
28 lines (23 loc) · 825 Bytes
/
sync_rules.ps1
File metadata and controls
28 lines (23 loc) · 825 Bytes
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
$rulesDir = ".roo/rules"
$outputFile = "GEMINI.md"
if (-not (Test-Path $rulesDir)) {
Write-Error "Directory $rulesDir not found."
exit 1
}
$content = @()
$content += "# Project Rules (Synced from .roo/rules)"
$content += ""
# Get all .md files, excluding those starting with a dot
$files = Get-ChildItem -Path $rulesDir -Filter "*.md" | Where-Object { $_.Name -notlike ".*" } | Sort-Object Name
foreach ($file in $files) {
$relativeLink = "$rulesDir/$($file.Name)"
$content += "## [$($file.BaseName)]($relativeLink)"
$content += ""
$fileContent = Get-Content -Path $file.FullName -Raw
$content += $fileContent
$content += ""
$content += "---"
$content += ""
}
$content | Out-File -FilePath $outputFile -Encoding utf8
Write-Host "Successfully generated $outputFile from $rulesDir"