DEV Community

Cover image for Flutter🐬 Auto increment shell command!
Kaede Games 🎮
Kaede Games 🎮

Posted on

Flutter🐬 Auto increment shell command!

Before deploy a flutter project, you always need to increment

  • version number
  • version code

In its pubspec.yaml

It’s so lazy.

Fortunately, below one line command would automatically increment them.

# Increment version
perl -i -pe 's/^(version:\s+\d+\.\d+\.\d+\+)(\d+)$/$1.($2+1)/e' pubspec.yaml
Enter fullscreen mode Exit fullscreen mode

Or run it by shellscript so that would be more simpler.

Top comments (0)