Home > @rushstack/package-deps-hash > getRepoRoot
getRepoRoot() function
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Finds the root of the current Git repository
Signature:
export declare function getRepoRoot(currentWorkingDirectory: string, gitPath?: string): string;
Parameters
Parameter | Type | Description |
---|---|---|
currentWorkingDirectory | string | The working directory for which to locate the repository |
gitPath | string | (Optional) The path to the Git executable |
Returns:
string
The full path to the root directory of the Git repository