2

I tried understanding the below pages, but both do not help me to solve my problem. Also I think I am still to much newbie to teach VSCode what I want to do.

How to have an auto incrementing version number (Visual Studio)

Can I automatically increment the file build version when using Visual Studio?

For my bash-scripts I would like to have some auto-incrementing build version. Lets say in third line of my bash-scripts some line like

# 1.0.2022.1740

This line should be automatically incremented by VSCode. When the script is running it can collect this number with

myVer=$(sed '3q;d' $0)

and would be able to mention it in its outputs, logfiles and --version.

# ./myscript --version
myscript version is 1.0.2022.1740

How do I teach VSCode to auto-increment this number in line three of my script at any save and or at any commit?

Is it possible to increment this line only when it exists and leave scripts untouched which do not contain this line ?

Gjiaffaar
  • 21
  • 2

0 Answers0