GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — build-combined: Fix failures when renaming across devices (#20620) · react/react@2b69851

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • scripts/rollup
    • build-all-release-channels.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎scripts/rollup/build-all-release-channels.js‎

Copy file name to clipboardExpand all lines: scripts/rollup/build-all-release-channels.js
+8-3Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/* eslint-disable no-for-of-loops/no-for-of-loops */
44

55
const fs = require('fs');
6+
const fse = require('fs-extra');
67
const {spawnSync} = require('child_process');
78
const path = require('path');
89
const tmp = require('tmp');
@@ -50,13 +51,13 @@ if (process.env.CIRCLE_NODE_TOTAL) {
5051
const stableVersion = '0.0.0-' + sha;
5152
buildForChannel('stable', '', '');
5253
const stableDir = tmp.dirSync().name;
53-
fs.renameSync('./build', stableDir);
54+
crossDeviceRenameSync('./build', stableDir);
5455
processStable(stableDir, stableVersion);
5556

5657
const experimentalVersion = '0.0.0-experimental-' + sha;
5758
buildForChannel('experimental', '', '');
5859
const experimentalDir = tmp.dirSync().name;
59-
fs.renameSync('./build', experimentalDir);
60+
crossDeviceRenameSync('./build', experimentalDir);
6061
processExperimental(experimentalDir, experimentalVersion);
6162

6263
// Then merge the experimental folder into the stable one. processExperimental
@@ -68,7 +69,7 @@ if (process.env.CIRCLE_NODE_TOTAL) {
6869
// Now restore the combined directory back to its original name
6970
// TODO: Currently storing artifacts as `./build2` so that it doesn't conflict
7071
// with old build job. Remove once we migrate rest of build/test pipeline.
71-
fs.renameSync(stableDir, './build2');
72+
crossDeviceRenameSync(stableDir, './build2');
7273
}
7374

7475
function buildForChannel(channel, nodeTotal, nodeIndex) {
@@ -139,6 +140,10 @@ function processExperimental(buildDir, version) {
139140
}
140141
}
141142

143+
function crossDeviceRenameSync(source, destination) {
144+
return fse.moveSync(source, destination, {overwrite: true});
145+
}
146+
142147
function updatePackageVersions(modulesDir, version) {
143148
const allReactModuleNames = fs.readdirSync('packages');
144149
for (const moduleName of fs.readdirSync(modulesDir)) {

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.