From f640785529ba1e0db0e8a5f238ecae2be5c7704e Mon Sep 17 00:00:00 2001 From: Adam Trotta Date: Wed, 23 Aug 2023 14:14:44 -0400 Subject: [PATCH] try copy and delete instead of rename --- test/integration/util.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/integration/util.ts b/test/integration/util.ts index 0b39a8080..025eadd08 100644 --- a/test/integration/util.ts +++ b/test/integration/util.ts @@ -1,6 +1,6 @@ import assert from 'assert'; import { exec } from 'child_process'; -import { promises as fs } from 'fs'; +import { copyFileSync, promises as fs, unlinkSync } from 'fs'; import * as fse from 'fs-extra'; import glob from 'glob'; import { join } from 'path'; @@ -160,7 +160,8 @@ export async function restoreFile(filePath: string, workspaceDir = ProjectA): Pr const dstPath = join(ProjectA, filePath); const tmpPath = dstPath + '.orig'; await executeWorkspaceOSCommand(`git show HEAD:./${filePath} > ${tmpPath}`, workspaceDir); - await fs.rename(tmpPath, dstPath); + copyFileSync(tmpPath, dstPath); + unlinkSync(tmpPath); } /**