UNPKG

valor-interview

Version:

CLI tool for downloading Valor interview challenges

51 lines 2.49 kB
/** * Creates a temporary directory with the configured prefix * @returns Path to the created temporary directory */ export declare const createTempDirectory: () => Promise<string>; /** * Clones a git repository to the specified destination * @param repoUrl - Repository URL to clone * @param destination - Destination directory path * @param branch - Git branch to clone (defaults to config) * @throws {Error} If the clone operation fails */ export declare const cloneRepository: (repoUrl: string, destination: string, branch?: string) => Promise<void>; /** * Safely removes a temporary directory * @param tempDir - Path to the temporary directory to remove */ export declare const cleanupTempDirectory: (tempDir: string) => Promise<void>; /** * Clones only a specific folder from a repository using sparse checkout * @param repoUrl - Repository URL to clone from * @param destination - Destination directory path * @param folderPath - Specific folder path to clone * @param branch - Git branch to clone (defaults to config) * @throws {Error} If the sparse checkout operation fails */ export declare const cloneSpecificFolder: (repoUrl: string, destination: string, folderPath: string, branch?: string) => Promise<void>; /** * Executes an operation with a temporary full repository clone * @param repoUrl - Repository URL to clone * @param operation - Operation to perform with the cloned repository * @param branch - Git branch to clone (optional) * @returns Result of the operation */ export declare const withTempRepository: <T>(repoUrl: string, operation: (repoPath: string) => Promise<T>, branch?: string) => Promise<T>; /** * Executes an operation with a specific folder cloned using sparse checkout * @param repoUrl - Repository URL to clone from * @param folderPath - Specific folder path to clone * @param operation - Operation to perform with the cloned folder * @param branch - Git branch to clone (optional) * @returns Result of the operation */ export declare const withSpecificFolder: <T>(repoUrl: string, folderPath: string, operation: (folderPath: string) => Promise<T>, branch?: string) => Promise<T>; /** * Initializes a git repository in the specified directory * Handles errors gracefully and logs warnings instead of throwing * @param destinationPath - Path where the git repository should be initialized */ export declare const initializeGitRepository: (destinationPath: string) => Promise<void>; //# sourceMappingURL=git.d.ts.map