Files
onefinity-firmware/scripts/next-rc
OneFinityCNC 24dfa6c64d Verison 1.0.3 Release
Based on Buildbotics 0.4.14
2020-08-27 23:20:27 -04:00

20 lines
394 B
Python

#!/usr/bin/env python3
import os
import json
if os.path.exists('dist/latest-beta.txt'):
with open('dist/latest-beta.txt', 'r') as f:
latest_beta = f.read().strip()
else: latest_beta = ''
with open('package.json', 'r') as f:
version = json.load(f)['version']
if latest_beta.startswith(version + '-rc'):
print(int(latest_beta[len(version) + 3:]) + 1)
else:
print(1)