MCPcopy Index your code
hub / github.com/github/awesome-copilot / fetchFileContent

Function fetchFileContent

website/src/scripts/utils.ts:141–152  ·  view source on GitHub ↗
(
  filePath: string
)

Source from the content-addressed store, hash-verified

139 * Fetch raw file content from GitHub
140 */
141export async function fetchFileContent(
142 filePath: string
143): Promise<string | null> {
144 try {
145 const response = await fetch(`${REPO_BASE_URL}/${filePath}`);
146 if (!response.ok) throw new Error(`Failed to fetch ${filePath}`);
147 return await response.text();
148 } catch (error) {
149 console.error(`Error fetching file content:`, error);
150 return null;
151 }
152}
153
154/**
155 * Copy text to clipboard

Callers 1

openFileModalFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected