I have published a package to pub.dev and I am making small changes. What is the easiest way to change all the package numbers in all the files? I usually search for the current version number in all files, for example 1.0.3 and replace it with 1.0.4, but this looks tedious. I am wondering if there is a better way? Like a function that updates the version with 1+.
Asked
Active
Viewed 54 times
0
-
In all which files? The only files you need to change are `pubspec.yaml`, possibly `README.md`, and `CHANGELOG.md` (in which you should be *adding*, not replacing). If you're putting package version numbers in all of your source files, then maybe you should stop doing that. – jamesdlin Dec 25 '22 at 08:08
-
Hi, thank you for your answer. There is a version 1.0.3 in: a lot actually in ios/..., including podfile.lock, .podspec.json, Pods-Runner-Info.plist and more, also in /example/linux/.../readme, macos/podfile.lock other in macos, and other in /example/... – Miro Dec 30 '22 at 16:39
1 Answers
1
If you're using vscode, you could make a replace all operation over all files :
- first, click the search icon on the left bar
- fill in the text you want to search and the text which you want to change with
- Click the replace all button

Gwhyyy
- 7,554
- 3
- 8
- 35
-
Hi. Thanks for your answer. I am doing it this way, but I am wondering if there is a better way to do it so that I don't have to manually replace it. Like a CLI that enables me to 1+ the version. – Miro Dec 24 '22 at 22:27