Skip to content

Commit

Permalink
version: 7.06.2008
Browse files Browse the repository at this point in the history
Signed-off-by: Dengfeng Liu <[email protected]>
  • Loading branch information
liudf0716 committed Jun 13, 2024
1 parent d5baa34 commit ce0a937
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 28 additions & 0 deletions generate_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

# Check if a command line argument is provided
if [ $# -eq 0 ]
then
echo "No arguments supplied. Please provide the major version."
exit 1
fi

# Get the major version from the command line argument
major_version=$1

# Get the current branch's commit count
commit_count=$(git rev-list --count HEAD)

# Get the current month
current_month=$(date +%m)

# Define the version
version="${major_version}.${current_month}.${commit_count}"

# Create the version.h file
cat << EOF > src/version.h
#ifndef _VERSION_
#define _VERSION_
#define VERSION "${version}"
#endif
EOF
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef _VERSION_
#define _VERSION_
#define VERSION "7.02.1977"
#define VERSION "7.06.2008"
#endif

0 comments on commit ce0a937

Please sign in to comment.