@begit/core
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -1,2 +0,2 @@ | ||
import { fetchLatestCommit, getFileWithHash, cachedir, cacheFileName, fetchTarball, toFile } from './chunk-5RFXWD6Y.js'; | ||
import { fetchLatestCommit, getFileWithHash, cachedir, cacheFileName, fetchTarball, toFile } from './chunk-RVYPRQ54.js'; | ||
import { join } from 'path'; | ||
@@ -7,3 +7,3 @@ import { extract } from 'tar/extract'; | ||
var downloadToFile = async (repo) => { | ||
var downloadToFile = async (repo, auth_token) => { | ||
const { owner, name, branch } = repo; | ||
@@ -54,2 +54,3 @@ let hash = repo.hash; | ||
cwd, | ||
auth_token, | ||
opts = { cache: true } | ||
@@ -56,0 +57,0 @@ }) => { |
@@ -1,3 +0,3 @@ | ||
export { begitDir, cacheFileName, cachedir, fetchLatestCommit, fetchTarball, getFileWithHash, getMostRecentCachedCommit, homedir, toFile } from './chunk-5RFXWD6Y.js'; | ||
export { begitDir, cacheFileName, cachedir, fetchLatestCommit, fetchTarball, getFileWithHash, getMostRecentCachedCommit, homedir, toFile } from './chunk-RVYPRQ54.js'; | ||
//# sourceMappingURL=utils.js.map | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "@begit/core", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Blazingly fast tool for cloning git repositories, with no reliance on local `git`, or `tar` installs", | ||
@@ -17,2 +17,3 @@ "author": "Thomas Beer", | ||
], | ||
"main": "./dist/index.js", | ||
"exports": { | ||
@@ -19,0 +20,0 @@ ".": { |
@@ -10,4 +10,10 @@ export type Repository = { | ||
}; | ||
export declare const downloadToFile: (repo: Repository) => Promise<string>; | ||
/** | ||
* Downloads the given repository to a tarball on the user's machine | ||
* | ||
* @param repo The repository to download | ||
* @param auth_token (optional) Github auth token for fetching | ||
*/ | ||
export declare const downloadToFile: (repo: Repository, auth_token?: string) => Promise<string>; | ||
/** | ||
* Extracts a tarball to a given path | ||
@@ -28,2 +34,3 @@ * @param tarPath Path to the tarfile to be extracted | ||
opts?: DownloadAndExtractOptions; | ||
auth_token?: string; | ||
}; | ||
@@ -33,3 +40,3 @@ /** | ||
*/ | ||
export declare const downloadAndExtract: ({ repo, dest, cwd, opts, }: DownloadAndExtract) => Promise<void>; | ||
export declare const downloadAndExtract: ({ repo, dest, cwd, auth_token, opts, }: DownloadAndExtract) => Promise<void>; | ||
/** | ||
@@ -36,0 +43,0 @@ * Wrapper around `downloadAndExtract`, which automatically attempts to re-download the tarball if extraction fails |
@@ -21,5 +21,6 @@ import { type PathLike } from "fs"; | ||
* @param repo Repository name | ||
* @param auth_token Optional parameter to authenticate Github API requests | ||
* @returns Most recent commit hash in repository | ||
*/ | ||
export declare const fetchLatestCommit: (owner: string, repo: string) => Promise<string>; | ||
export declare const fetchLatestCommit: (owner: string, repo: string, auth_token?: string) => Promise<string>; | ||
export declare const getFileWithHash: (repoOwner: string, repoName: string, hash: string) => Promise<string>; | ||
@@ -26,0 +27,0 @@ /** |
Sorry, the diff of this file is not supported yet
24939
222