Skip to content

Commit

Permalink
sync-react: Fix --version and --no-install being ignored (#69317)
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Aug 27, 2024
1 parent d23a7b1 commit 53cf8e2
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions scripts/sync-react.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,11 @@ async function getChangelogFromGitHub(baseSha, newSha) {
async function main() {
const cwd = process.cwd()
const errors = []
const { noInstall, version } = await yargs(process.argv.slice(2))
.options('version', { default: null, type: 'string' })
.options('no-install', { default: false, type: 'boolean' }).argv
const argv = await yargs(process.argv.slice(2))
.version(false)
.options('install', { default: true, type: 'boolean' })
.options('version', { default: null, type: 'string' }).argv
const { install, version } = argv

let newVersionStr = version
if (newVersionStr === null) {
Expand Down Expand Up @@ -198,14 +200,14 @@ Or, run this command with no arguments to use the most recently published versio
newDateString,
newSha,
newVersionStr,
noInstall,
noInstall: !install,
channel: 'experimental',
})
await sync({
newDateString,
newSha,
newVersionStr,
noInstall,
noInstall: !install,
channel: 'rc',
})

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

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

if (noInstall) {
if (!install) {
console.log(
`
To finish upgrading, complete the following steps:
Expand Down

0 comments on commit 53cf8e2

Please sign in to comment.