Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config packageFiles BUG #931

Open
z-sq opened this issue Dec 29, 2022 · 0 comments
Open

config packageFiles BUG #931

z-sq opened this issue Dec 29, 2022 · 0 comments
Labels

Comments

@z-sq
Copy link

z-sq commented Dec 29, 2022

Describe the bug

// standard-version/command.js: 11
  .option('bumpFiles', {
    default: defaults.bumpFiles,
    array: true
  })

... 
// standard-version/index.js: 40
/**
 * If an argument for `packageFiles` provided, we include it as a "default" `bumpFile`.
 */
if (argv.packageFiles) {
  defaults.bumpFiles = defaults.bumpFiles.concat(argv.packageFiles)
}

const args = Object.assign({}, defaults, argv)

Current behavior

// .versionrc
{
"packageFiles": [
    {
      "filename": "src/manifest.json",
      "updater": "manifest-version-updater.js"
    }
  ]
}

argv.bumpFiles 覆盖 defaults. bumpFiles;

if (argv.packageFiles) {
  defaults.bumpFiles = defaults.bumpFiles.concat(argv.packageFiles)
}

code失去作用

Expected behavior
.versionrc 不设置 bumpFiles,
npx standard-version -u
defaults.bumpFiles = defaults.bumpFiles.concat(argv.packageFiles) 发挥作用

Environment

  • standard-version version(s): [v9.5.0, master]
  • Node/npm version: [e.g. Node 18.12.1/npm 8.19.2]
  • OS: [OSX 13.0.1]

Possible Solution

delete
.option('bumpFiles', {
default: defaults.bumpFiles,
array: true
})

@z-sq z-sq added the bug label Dec 29, 2022
@z-sq z-sq changed the title packageFiles BUG config packageFiles BUG Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant