-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcreate_git_tag.sh
More file actions
executable file
·29 lines (24 loc) · 873 Bytes
/
create_git_tag.sh
File metadata and controls
executable file
·29 lines (24 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# SPDX-FileCopyrightText: 2024 Artur Bać
# SPDX-License-Identifier: BSL-1.0
# SPDX-PackageHomePage: https://github.com/arturbac/simple_enum
# Path to the header file
file_path="include/simple_enum/core.hpp"
# Check if the file exists
if [ -f "$file_path" ]; then
# Extract the version number using grep and awk
version=$(grep "SIMPLE_ENUM_NAME_VERSION" $file_path | awk -F '"' '{print $2}')
# Check if version was found
if [ -z "$version" ]; then
echo "Version not found in $file_path"
exit 1
fi
# Format the version for git tagging
# Assuming the version in the file does not have a 'v' prefix and is in the form x.y.z
git_tag="v${version}"
# Create the Git tag
git tag -a "$git_tag" -m "Release $git_tag"
echo "Git tag $git_tag created."
else
echo "File $file_path does not exist."
fi