[CI-SKIP] Stash Claude Edits

This commit is contained in:
2026-05-06 20:10:11 -05:00
parent fb1abd6211
commit 8c6ab6dc83
3 changed files with 40 additions and 11 deletions

View File

@@ -66,12 +66,12 @@ func VerifyOwnership(ws *common.GitWorkspace, uuid string) (bool, error) {
return false, fmt.Errorf("domain is owned by server %q", existing)
}
// AddAndPushCerts stages every *.crpt file from dataRoot into the workspace,
// AddAndPushCerts stages every *.crpt file from certsDir into the workspace,
// (re-)writes SERVER_ID with config.App.UUID, commits any resulting change,
// and pushes to origin/<pushBranch>. If nothing changed the call is a no-op
// and returns nil without pushing.
func AddAndPushCerts(ws *common.GitWorkspace, dataRoot string, config *common.AppConfig) error {
if err := stageCerts(ws, dataRoot); err != nil {
func AddAndPushCerts(ws *common.GitWorkspace, certsDir string, config *common.AppConfig) error {
if err := stageCerts(ws, certsDir); err != nil {
return err
}
if err := stageFile(ws, serverIDFile, []byte(config.App.UUID)); err != nil {
@@ -111,19 +111,19 @@ func AddAndPushCerts(ws *common.GitWorkspace, dataRoot string, config *common.Ap
return nil
}
// stageCerts copies every *.crpt file in dataRoot into the workspace
// stageCerts copies every *.crpt file in certsDir into the workspace
// filesystem and adds it to the work tree.
func stageCerts(ws *common.GitWorkspace, dataRoot string) error {
entries, err := os.ReadDir(dataRoot)
func stageCerts(ws *common.GitWorkspace, certsDir string) error {
entries, err := os.ReadDir(certsDir)
if err != nil {
return fmt.Errorf("read %s: %w", dataRoot, err)
return fmt.Errorf("read %s: %w", certsDir, err)
}
for _, entry := range entries {
name := entry.Name()
if !strings.HasSuffix(name, ".crpt") {
continue
}
body, err := os.ReadFile(filepath.Join(dataRoot, name))
body, err := os.ReadFile(filepath.Join(certsDir, name))
if err != nil {
return fmt.Errorf("read %s: %w", name, err)
}