Build [v1.7.0] - GitGuard - Infrastructure Hardening

This commit is contained in:
Daniel Bedeleanu
2026-04-12 22:45:27 +03:00
parent 0a6368b9f6
commit 994920bda2
14 changed files with 262 additions and 76 deletions

View File

@@ -24,7 +24,7 @@ def run_command(cmd):
def main():
git = get_git_path()
# 1. Read and Increment Version
# 1. Read and Parse Version
if not os.path.exists(VERSION_FILE):
print(f"Error: {VERSION_FILE} not found.")
sys.exit(1)
@@ -34,10 +34,20 @@ def main():
old_version = data.get('version', '1.0.0')
parts = old_version.split('.')
if len(parts) == 3:
parts[2] = str(int(parts[2]) + 1)
if len(parts) < 3:
parts.extend(['0'] * (3 - len(parts)))
# Check for --minor or --major flags
if '--minor' in sys.argv:
parts[1] = str(int(parts[1]) + 1)
parts[2] = '0'
elif '--major' in sys.argv:
parts[0] = str(int(parts[0]) + 1)
parts[1] = '0'
parts[2] = '0'
else:
parts.append('1')
# Default: patch increment
parts[2] = str(int(parts[2]) + 1)
new_version = '.'.join(parts)
data['version'] = new_version