Skip to content

Commit 53cf8e2

Browse files
authored
sync-react: Fix --version and --no-install being ignored (#69317)
1 parent d23a7b1 commit 53cf8e2

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

scripts/sync-react.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,11 @@ async function getChangelogFromGitHub(baseSha, newSha) {
153153
async function main() {
154154
const cwd = process.cwd()
155155
const errors = []
156-
const { noInstall, version } = await yargs(process.argv.slice(2))
157-
.options('version', { default: null, type: 'string' })
158-
.options('no-install', { default: false, type: 'boolean' }).argv
156+
const argv = await yargs(process.argv.slice(2))
157+
.version(false)
158+
.options('install', { default: true, type: 'boolean' })
159+
.options('version', { default: null, type: 'string' }).argv
160+
const { install, version } = argv
159161

160162
let newVersionStr = version
161163
if (newVersionStr === null) {
@@ -198,14 +200,14 @@ Or, run this command with no arguments to use the most recently published versio
198200
newDateString,
199201
newSha,
200202
newVersionStr,
201-
noInstall,
203+
noInstall: !install,
202204
channel: 'experimental',
203205
})
204206
await sync({
205207
newDateString,
206208
newSha,
207209
newVersionStr,
208-
noInstall,
210+
noInstall: !install,
209211
channel: 'rc',
210212
})
211213

@@ -268,7 +270,7 @@ Or, run this command with no arguments to use the most recently published versio
268270
}
269271

270272
// Install the updated dependencies and build the vendored React files.
271-
if (noInstall) {
273+
if (!install) {
272274
console.log('Skipping install step because --no-install flag was passed.\n')
273275
} else {
274276
console.log('Installing dependencies...\n')
@@ -328,7 +330,7 @@ Or, run this command with no arguments to use the most recently published versio
328330
)
329331
}
330332

331-
if (noInstall) {
333+
if (!install) {
332334
console.log(
333335
`
334336
To finish upgrading, complete the following steps:

0 commit comments

Comments
 (0)