version_files not working #1382
-
| DescriptionI'm using commitizen in a expo + react-native project {
  "commitizen": {
    "name": "cz_conventional_commits",
    "tag_format": "test-$version",
    "version_scheme": "semver",
    "version": "3.2.4",
    "update_changelog_on_bump": true,
    "version_files": [
      "package.json:version",
      "app.json:expo.version"
    ]
  }
}btw I select  then I do  I'm not sure is it a bug or not, Steps to reproduce
 Current behaviorafter I setting  Desired behaviorI want these 3 files update with same and correct version 
 ScreenshotsNo response EnvironmentCommitizen Version: 4.4.1 | 
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
| Hello Edit In a situation where I have set the cz.toml configuration file in the root folder 
 [tool.commitizen]
name = "cz_conventional_commits"
tag_format = "$version"
version_scheme = "semver"
version = "1.6.5-b23"
update_changelog_on_bump = false
major_version_zero = false
annotated_tag = false
version_files = [
    "package.json:version",
    "src/package.json:version",
    "src/pyproject.toml:version"
]Another solution was to have pyproject.toml (or the appropriate manifest for configuration) in the root folder, which contained only information about the version [tool.poetry]
version = "1.6.5-b23"cz by default searches for the location in search of the manifest file. | 
Beta Was this translation helpful? Give feedback.
-
| thank you for solving the problem. I will try this later. | 
Beta Was this translation helpful? Give feedback.
-
| Hey, sorry for the late reply. may I know what the format of it needs to be in the same line like if they're set in the version_file, we do not detect  | 
Beta Was this translation helpful? Give feedback.
-
| hello I'm back. these is my file format. 
 {
  "commitizen": {
    "name": "cz_conventional_commits",
    "tag_format": "test-$version",
    "version_scheme": "semver",
    "version": "3.124.0",
    "update_changelog_on_bump": true,
    "version_files": [
      "package.json:version",
      "app.json:expo.version"
    ]
  }
}
 {
    "name": "",
    "version": "3.124.0",
    "scripts": {},
    "dependencies": {},
}
 {
  "expo": {
    "name": "",
    "slug": "",
    "scheme": "",
    "version": "3.123.0",
    "ios": {},
    "android": {}
}I try the @kamilgajekdxc solution. after run  thanks @kamilgajekdxc , set to same version is really helpful. my package.json do update. I found the problem. cz bump update "expo.version": "" to correct version and keep "expo": {"version": ""} in old version. now my question is how to set the correct version property in  | 
Beta Was this translation helpful? Give feedback.
I think you'll need to implement a customized version_provider. Unfortunatly, we don't have a smart enough way to specify complicated conditions in
version_files, but we welcome feature proposals 🙂