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

Method readFile

packages/decap-cms-backend-github/src/API.ts:645–663  ·  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

643 }
644
645 async readFile(
646 path: string,
647 sha?: string | null,
648 {
649 branch = this.branch,
650 repoURL = this.repoURL,
651 parseText = true,
652 }: {
653 branch?: string;
654 repoURL?: string;
655 parseText?: boolean;
656 } = {},
657 ) {
658 if (!sha) {
659 sha = await this.getFileSha(path, { repoURL, branch });
660 }
661 const content = await this.fetchBlobContent({ sha: sha as string, repoURL, parseText });
662 return content;
663 }
664
665 async readFileMetadata(path: string, sha: string | null | undefined) {
666 const fetchFileMetadata = async () => {

Callers

nothing calls this directly

Calls 2

getFileShaMethod · 0.95
fetchBlobContentMethod · 0.95

Tested by

no test coverage detected