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)