mirror of
https://github.com/myronblair/codex-permanent-memory
synced 2026-06-30 17:50:55 -05:00
Initial permanent memory repository
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
param(
|
||||
[string]$Message = ""
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$repoRoot = Split-Path -Parent $PSScriptRoot
|
||||
$git = "C:\Program Files\Git\cmd\git.exe"
|
||||
|
||||
if (-not (Test-Path $git)) {
|
||||
throw "git.exe was not found at $git"
|
||||
}
|
||||
|
||||
$branch = (& $git -C $repoRoot branch --show-current).Trim()
|
||||
if (-not $branch) {
|
||||
throw "No active git branch was found."
|
||||
}
|
||||
|
||||
$status = & $git -C $repoRoot status --porcelain
|
||||
if (-not $status) {
|
||||
Write-Host "No changes to sync."
|
||||
exit 0
|
||||
}
|
||||
|
||||
if (-not $Message) {
|
||||
$Message = "Permanent memory sync $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')"
|
||||
}
|
||||
|
||||
& $git -C $repoRoot add -A
|
||||
& $git -C $repoRoot commit -m $Message
|
||||
& $git -C $repoRoot push origin $branch
|
||||
|
||||
Write-Host "Synced branch '$branch' to origin."
|
||||
Reference in New Issue
Block a user