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

Method readFile

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

668 }
669
670 async readFile(
671 path: string,
672 sha?: string | null,
673 {
674 branch = this.branch,
675 repoURL = this.repoURL,
676 parseText = true,
677 }: {
678 branch?: string;
679 repoURL?: string;
680 parseText?: boolean;
681 } = {},
682 ) {
683 if (!sha) {
684 sha = await this.getFileSha(path, { repoURL, branch });
685 }
686 const content = await this.fetchBlobContent({ sha: sha as string, repoURL, parseText });
687 return content;
688 }
689
690 async readFileMetadata(path: string, sha: string | null | undefined) {
691 const fetchFileMetadata = async () => {

Callers

nothing calls this directly

Calls 2

getFileShaMethod · 0.95
fetchBlobContentMethod · 0.95

Tested by

no test coverage detected