We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a55e56 commit a92ba99Copy full SHA for a92ba99
packages/core/src/test/testUtil.ts
@@ -622,7 +622,11 @@ function setPath(newPath: string): void {
622
function readPath(): string {
623
return process.env.PATH || ''
624
}
625
-
+/**
626
+ * Overwrite the $PATH environment variable for the span of the provided task, then reset it.
627
+ * @param newPath temporary $PATH value
628
+ * @param task work to be done with $PATH set.
629
+ */
630
export async function withEnvPath(newPath: string, task: () => Promise<void>): Promise<void | never> {
631
const originalPath = readPath()
632
setPath(newPath)
0 commit comments