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

Method readFile

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

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

Callers

nothing calls this directly

Calls 2

getFileShaMethod · 0.95
fetchBlobContentMethod · 0.95

Tested by

no test coverage detected