WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.

Commit 152f787

Browse files
committed
fix: remove references to deleted GetConfigTemplates function
The initConfig function was still referencing services.GetConfigTemplates() and services.ConfigTemplate which were removed in the legacy code cleanup. Simplified initConfig to use a basic inline template instead.
1 parent 2873bda commit 152f787

File tree

1 file changed

+26
-22
lines changed
  • examples-copier/cmd/config-validator

1 file changed

+26
-22
lines changed

examples-copier/cmd/config-validator/main.go

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -187,31 +187,35 @@ func testTransform(source, template, varsStr string) {
187187
}
188188

189189
func initConfig(templateName, output string) {
190-
templates := services.GetConfigTemplates()
191-
var selectedTemplate *services.ConfigTemplate
192-
193-
for _, tmpl := range templates {
194-
if tmpl.Name == templateName {
195-
selectedTemplate = &tmpl
196-
break
197-
}
198-
}
199-
200-
if selectedTemplate == nil {
201-
fmt.Printf("❌ Unknown template: %s\n", templateName)
202-
fmt.Println("\nAvailable templates:")
203-
for _, tmpl := range templates {
204-
fmt.Printf(" %s - %s\n", tmpl.Name, tmpl.Description)
205-
}
206-
os.Exit(1)
207-
}
208-
209-
err := os.WriteFile(output, []byte(selectedTemplate.Content), 0644)
190+
// Simple workflow config template
191+
template := `# Workflow Configuration
192+
# This file defines workflows for copying code examples between repositories
193+
194+
workflows:
195+
- name: "example-workflow"
196+
source:
197+
repo: "mongodb/source-repo"
198+
branch: "main"
199+
path: "examples"
200+
destination:
201+
repo: "mongodb/dest-repo"
202+
branch: "main"
203+
transformations:
204+
- move:
205+
from: "examples"
206+
to: "code-examples"
207+
commit_strategy:
208+
type: "pr"
209+
pr_title: "Update code examples"
210+
pr_body: "Automated update from source repository"
211+
`
212+
213+
err := os.WriteFile(output, []byte(template), 0644)
210214
if err != nil {
211215
fmt.Printf("❌ Error writing config file: %v\n", err)
212216
os.Exit(1)
213217
}
214218

215-
fmt.Printf("✅ Created config file: %s\n", output)
216-
fmt.Printf("Template: %s\n", selectedTemplate.Description)
219+
fmt.Printf("✅ Created workflow config file: %s\n", output)
220+
fmt.Println("Edit this file to configure your workflows")
217221
}

0 commit comments

Comments
 (0)