MCPcopy Create free account
hub / github.com/decaporg/decap-cms / readFile

Method readFile

packages/decap-cms-backend-gitea/src/API.ts:271–289  ·  view source on GitHub ↗
(
    path: string,
    sha?: string | null,
    {
      branch = this.branch,
      repoURL = this.repoURL,
      parseText = true,
    }: {
      branch?: string;
      repoURL?: string;
      parseText?: boolean;
    } = {},
  )

Source from the content-addressed store, hash-verified

269 }
270
271 async readFile(
272 path: string,
273 sha?: string | null,
274 {
275 branch = this.branch,
276 repoURL = this.repoURL,
277 parseText = true,
278 }: {
279 branch?: string;
280 repoURL?: string;
281 parseText?: boolean;
282 } = {},
283 ) {
284 if (!sha) {
285 sha = await this.getFileSha(path, { repoURL, branch });
286 }
287 const content = await this.fetchBlobContent({ sha: sha as string, repoURL, parseText });
288 return content;
289 }
290
291 async readFileMetadata(path: string, sha: string | null | undefined) {
292 const fetchFileMetadata = async () => {

Callers 8

uploadFilesMethod · 0.95
entriesFromFilesFunction · 0.45
readMediaFileFunction · 0.45
fetchDataFunction · 0.45
updateConfigFunction · 0.45
switchVersionFunction · 0.45
commands.jsFile · 0.45

Calls 2

getFileShaMethod · 0.95
fetchBlobContentMethod · 0.95

Tested by

no test coverage detected