Skip to content

Commit 2c338b1

Browse files
Added windows powershell syntax to build scripts (#27692)
## Summary I had to change the commands to be windows specific so that it doesn't cause any crashes ## How did you test this change? I successfully built the different types of devtools extenstions on my personal computer. In future may need to add a github action with windows config to test these errors #27193
1 parent ee68446 commit 2c338b1

File tree

5 files changed

+17
-14
lines changed

5 files changed

+17
-14
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
"rollup-plugin-prettier": "^4.1.1",
9292
"rollup-plugin-strip-banner": "^3.0.0",
9393
"semver": "^7.1.1",
94+
"shelljs":"^0.8.5",
9495
"signedsource": "^2.0.0",
9596
"targz": "^1.0.1",
9697
"through2": "^3.0.1",
@@ -108,7 +109,7 @@
108109
"scripts": {
109110
"build": "node ./scripts/rollup/build-all-release-channels.js",
110111
"build-combined": "echo 'build-combined is deprecated. yarn build instead.'",
111-
"build-for-devtools": "cross-env RELEASE_CHANNEL=experimental yarn build react/index,react/jsx,react-dom/index,react-dom/unstable_testing,react-dom/test-utils,react-is,react-debug-tools,scheduler,react-test-renderer,react-refresh,react-art --type=NODE && cp -r ./build/node_modules build/oss-experimental/",
112+
"build-for-devtools": "cross-env RELEASE_CHANNEL=experimental yarn build react/index,react/jsx,react-dom/index,react-dom/unstable_testing,react-dom/test-utils,react-is,react-debug-tools,scheduler,react-test-renderer,react-refresh,react-art --type=NODE",
112113
"build-for-devtools-dev": "yarn build-for-devtools --type=NODE_DEV",
113114
"build-for-devtools-prod": "yarn build-for-devtools --type=NODE_PROD",
114115
"linc": "node ./scripts/tasks/linc.js",

packages/react-devtools-extensions/deploy.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
const {exec, execSync} = require('child_process');
66
const {readFileSync, writeFileSync} = require('fs');
77
const {join} = require('path');
8-
8+
const shell = require('shelljs');
99
const main = async buildId => {
1010
const root = join(__dirname, buildId);
1111
const buildPath = join(root, 'build');
@@ -18,11 +18,7 @@ const main = async buildId => {
1818
},
1919
stdio: 'inherit',
2020
});
21-
22-
await exec(`cp ${join(root, 'now.json')} ${join(buildPath, 'now.json')}`, {
23-
cwd: root,
24-
});
25-
21+
shell.cp(join(root, 'now.json'), join(buildPath, 'now.json'));
2622
const file = readFileSync(join(root, 'now.json'));
2723
const json = JSON.parse(file);
2824
const alias = json.alias[0];

scripts/release/build-release-locally-commands/build-artifacts.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
const {exec} = require('child-process-promise');
66
const {join} = require('path');
77
const {logPromise} = require('../utils');
8+
const shell = require('shelljs');
89

910
const run = async ({cwd, dry, tempDirectory}) => {
1011
const defaultOptions = {
@@ -17,7 +18,7 @@ const run = async ({cwd, dry, tempDirectory}) => {
1718
const tempNodeModulesPath = join(tempDirectory, 'build', 'node_modules');
1819
const buildPath = join(cwd, 'build');
1920

20-
await exec(`cp -r ${tempNodeModulesPath} ${buildPath}`);
21+
shell.cp('-r', tempNodeModulesPath, buildPath);
2122
};
2223

2324
module.exports = async params => {

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const fse = require('fs-extra');
88
const {spawnSync} = require('child_process');
99
const path = require('path');
1010
const tmp = require('tmp');
11-
11+
const shell = require('shelljs');
1212
const {
1313
ReactVersion,
1414
stablePackages,
@@ -115,11 +115,7 @@ function processStable(buildDir) {
115115
if (fs.existsSync(buildDir + '/node_modules')) {
116116
// Identical to `oss-stable` but with real, semver versions. This is what
117117
// will get published to @latest.
118-
spawnSync('cp', [
119-
'-r',
120-
buildDir + '/node_modules',
121-
buildDir + '/oss-stable-semver',
122-
]);
118+
shell.cp('-r', buildDir + '/node_modules', buildDir + '/oss-stable-semver');
123119

124120
const defaultVersionIfNotFound = '0.0.0' + '-' + sha + '-' + dateString;
125121
const versionsMap = new Map();

yarn.lock

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13871,6 +13871,15 @@ shelljs@0.7.7:
1387113871
interpret "^1.0.0"
1387213872
rechoir "^0.6.2"
1387313873

13874+
shelljs@^0.8.5:
13875+
version "0.8.5"
13876+
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.5.tgz#de055408d8361bed66c669d2f000538ced8ee20c"
13877+
integrity sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==
13878+
dependencies:
13879+
glob "^7.0.0"
13880+
interpret "^1.0.0"
13881+
rechoir "^0.6.2"
13882+
1387413883
shellwords@^0.1.1:
1387513884
version "0.1.1"
1387613885
resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"

0 commit comments

Comments
 (0)