Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rachfop committed May 16, 2024
1 parent d3752d4 commit 516035b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,18 @@ class Sync {
return;
}

// getFileContent gets the content of a single file from Github
async getFileContent(owner, repo, ref, filePath) {
const result = await this.github.repos.getContent({
owner,
repo,
path: filePath,
ref,
});
const content = Buffer.from(result.data.content, 'base64');
return content;
}

// extractSnippets is the method that retrieves code snippets from the downloaded repos
async extractSnippets(repositories) {
const snippets = [];
Expand Down

0 comments on commit 516035b

Please sign in to comment.