Skip to content

Commit

Permalink
quick save: Thu Dec 26 07:26:56 MSK 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
nikelborm committed Dec 26, 2024
1 parent 6fe8acf commit 8f83e40
Show file tree
Hide file tree
Showing 8 changed files with 252 additions and 72 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ Then [get personal github access token here](https://github.com/settings/tokens)
3. support downloading not only folders, but also individual files
4. support creating downloading plans, where user can specify more than one entity (folder/file) to download
5. support git submodules
6. fix shit that files created with different flags than they are in repo (for example scripts missing x flag)
6. add autodeterminator that this is a public repo and we don't need an API key
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
downloadDirectoryRecursively,
getEnvVarOrFail,
getEnvVarOrFail
} from "./src/index.js";

await downloadDirectoryRecursively({
Expand Down
167 changes: 167 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"author": {
"name": "nikelborm",
"email": "kolya007.klass@gmail.com",
"email": "evadev@duck.com",
"url": "https://github.com/nikelborm"
},
"license": "MIT",
Expand All @@ -18,7 +18,9 @@
"@octokit/core": "^6.1.2",
"@total-typescript/ts-reset": "^0.5.1",
"@types/node": "^22.8.1",
"@types/tar-fs": "^2.0.4",
"@vercel/ncc": "^0.38.1",
"tar-fs": "^3.0.6",
"tsafe": "^1.6.6",
"tsx": "^4.13.2",
"typescript": "^5.4.5"
Expand Down
6 changes: 3 additions & 3 deletions src/downloadDirectoryContentsMetaInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ import { octokit } from './octokit.js';

export async function downloadDirectoryContentsMetaInfo({
repo,
commitShaHashOrBranchNameOrTagName,
gitRef,
pathToDirectory
}: {
repo: {
owner: string,
name: string
},
pathToDirectory: string,
commitShaHashOrBranchNameOrTagName: string,
gitRef: string,
}) {
const { data: contentsOfDirectory } = await octokit.request(
'GET /repos/{owner}/{repo}/contents/{path}',
{
owner: repo.owner,
repo: repo.name,
path: pathToDirectory,
ref: commitShaHashOrBranchNameOrTagName,
ref: gitRef,
headers: {
'X-GitHub-Api-Version': '2022-11-28'
},
Expand Down
Loading

0 comments on commit 8f83e40

Please sign in to comment.