MCPcopy Index your code
hub / github.com/coder/coder / autoversion

Method autoversion

scripts/release/main.go:315–339  ·  view source on GitHub ↗

autoversion automatically updates the provided channel to version in markdown files.

(ctx context.Context, channel, version string)

Source from the content-addressed store, hash-verified

313// autoversion automatically updates the provided channel to version in markdown
314// files.
315func (r *releaseCommand) autoversion(ctx context.Context, channel, version string) error {
316 var files []string
317
318 // For now, scope this to docs, perhaps we include README.md in the future.
319 if err := afero.Walk(r.fs, "docs", func(path string, _ fs.FileInfo, err error) error {
320 if err != nil {
321 return err
322 }
323 if strings.EqualFold(filepath.Ext(path), ".md") {
324 files = append(files, path)
325 }
326 return nil
327 }); err != nil {
328 return xerrors.Errorf("walk failed: %w", err)
329 }
330
331 for _, file := range files {
332 err := r.autoversionFile(ctx, file, channel, version)
333 if err != nil {
334 return xerrors.Errorf("autoversion file failed: %w", err)
335 }
336 }
337
338 return nil
339}
340
341// autoversionMarkdownPragmaRe matches the autoversion pragma in markdown files.
342//

Callers 2

Test_release_autoversionFunction · 0.95
mainFunction · 0.95

Calls 2

autoversionFileMethod · 0.95
ErrorfMethod · 0.45

Tested by 1

Test_release_autoversionFunction · 0.76