File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import type {
1111 PipelineV2 ,
1212} from "@turbo/types" ;
1313import * as logger from "./logger" ;
14- import { getTurboRoot } from "./getTurboRoot" ;
14+ import { getTurboRoot , clearTurboRootCache } from "./getTurboRoot" ;
1515import type { PackageJson , PNPMWorkspaceConfig } from "./types" ;
1616
1717const ROOT_GLOB = "{turbo.json,turbo.jsonc}" ;
@@ -302,4 +302,5 @@ export function clearConfigCaches(): void {
302302 // eslint-disable-next-line @typescript-eslint/no-dynamic-delete -- This is safe.
303303 delete workspaceConfigCache [ key ] ;
304304 } ) ;
305+ clearTurboRootCache ( ) ;
305306}
Original file line number Diff line number Diff line change @@ -14,6 +14,13 @@ function contentCheck(content: string): boolean {
1414
1515const configCache : Record < string , string > = { } ;
1616
17+ export function clearTurboRootCache ( ) : void {
18+ Object . keys ( configCache ) . forEach ( ( key ) => {
19+ // eslint-disable-next-line @typescript-eslint/no-dynamic-delete -- This is safe.
20+ delete configCache [ key ] ;
21+ } ) ;
22+ }
23+
1724export function getTurboRoot ( cwd ?: string , opts ?: Options ) : string | null {
1825 const cacheEnabled = opts ?. cache ?? true ;
1926 const currentDir = cwd || process . cwd ( ) ;
Original file line number Diff line number Diff line change 11// utils
2- export { getTurboRoot } from "./getTurboRoot" ;
2+ export { getTurboRoot , clearTurboRootCache } from "./getTurboRoot" ;
33export {
44 getTurboConfigs ,
55 getWorkspaceConfigs ,
You can’t perform that action at this time.
0 commit comments