(docsPath string)
| 105 | } |
| 106 | |
| 107 | func generateRemoteServerDocs(docsPath string) error { |
| 108 | content, err := os.ReadFile(docsPath) //#nosec G304 |
| 109 | if err != nil { |
| 110 | return fmt.Errorf("failed to read docs file: %w", err) |
| 111 | } |
| 112 | |
| 113 | toolsetsDoc := generateRemoteToolsetsDoc() |
| 114 | |
| 115 | // Replace content between markers |
| 116 | updatedContent, err := replaceSection(string(content), "START AUTOMATED TOOLSETS", "END AUTOMATED TOOLSETS", toolsetsDoc) |
| 117 | if err != nil { |
| 118 | return err |
| 119 | } |
| 120 | |
| 121 | // Also generate remote-only toolsets section |
| 122 | remoteOnlyDoc := generateRemoteOnlyToolsetsDoc() |
| 123 | updatedContent, err = replaceSection(updatedContent, "START AUTOMATED REMOTE TOOLSETS", "END AUTOMATED REMOTE TOOLSETS", remoteOnlyDoc) |
| 124 | if err != nil { |
| 125 | return err |
| 126 | } |
| 127 | |
| 128 | return os.WriteFile(docsPath, []byte(updatedContent), 0600) //#nosec G306 |
| 129 | } |
| 130 | |
| 131 | // octiconImg returns an img tag for an Octicon that works with GitHub's light/dark theme. |
| 132 | // Uses picture element with prefers-color-scheme for automatic theme switching. |
nothing calls this directly
no test coverage detected