Skip to content

Commit 8f9aa56

Browse files
committed
fix: use cp over over rename
rename does not work across devices and the os tmp might be on a different device
1 parent 66b59af commit 8f9aa56

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/open-next/src/build.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ export async function build(
4747
showWindowsWarning();
4848

4949
// Load open-next.config.ts
50-
const tempBuildDir = fs.mkdtempSync(
51-
path.join(os.tmpdir(), ".open-next-temp"),
52-
);
50+
const tempBuildDir = fs.mkdtempSync(path.join(os.tmpdir(), "open-next-tmp"));
5351
let configPath = compileOpenNextConfigNode(
5452
tempBuildDir,
5553
openNextConfigPath,
@@ -176,7 +174,7 @@ function initOutputDir(options: BuildOptions) {
176174
fs.rmSync(options.outputDir, { recursive: true, force: true });
177175
const { buildDir } = options;
178176
fs.mkdirSync(buildDir, { recursive: true });
179-
fs.renameSync(options.tempBuildDir, buildDir);
177+
fs.cpSync(options.tempBuildDir, buildDir, { recursive: true });
180178
}
181179

182180
async function createWarmerBundle(options: BuildOptions) {

0 commit comments

Comments
 (0)