Skip to content

Commit

Permalink
try copy and delete instead of rename
Browse files Browse the repository at this point in the history
  • Loading branch information
ahtrotta committed Aug 23, 2023
1 parent 5a62f1b commit f640785
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/integration/util.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit f640785

Please sign in to comment.