patch.py now commits change to currentHash

This commit is contained in:
cyian-1756 2018-06-07 07:44:55 -04:00
parent 5c0260fb2a
commit c671cb3ec5

View File

@ -12,11 +12,13 @@ from hashlib import sha256
message = input('message: ') message = input('message: ')
def get_ripme_json(): def get_ripme_json():
with open('ripme.json') as dataFile: with open('ripme.json') as dataFile:
ripmeJson = json.load(dataFile) ripmeJson = json.load(dataFile)
return ripmeJson return ripmeJson
def update_hash(current_hash): def update_hash(current_hash):
ripmeJson = get_ripme_json() ripmeJson = get_ripme_json()
with open('ripme.json', 'w') as dataFile: with open('ripme.json', 'w') as dataFile:
@ -24,6 +26,7 @@ def update_hash(current_hash):
print(ripmeJson["currentHash"]) print(ripmeJson["currentHash"])
json.dump(ripmeJson, dataFile, indent=4) json.dump(ripmeJson, dataFile, indent=4)
def update_change_list(message): def update_change_list(message):
ripmeJson = get_ripme_json() ripmeJson = get_ripme_json()
with open('ripme.json', 'w') as dataFile: with open('ripme.json', 'w') as dataFile:
@ -72,9 +75,6 @@ dataFile = open("ripme.json", "w")
dataFile.write(outputContent) dataFile.write(outputContent)
dataFile.close() dataFile.close()
subprocess.call(['git', 'add', '-u'])
subprocess.call(['git', 'commit', '-m', commitMessage])
subprocess.call(['git', 'tag', nextVersion])
print("Building ripme") print("Building ripme")
subprocess.call(["mvn", "clean", "compile", "assembly:single"]) subprocess.call(["mvn", "clean", "compile", "assembly:single"])
print("Stripping jar") print("Stripping jar")
@ -86,3 +86,6 @@ file_hash = sha256(readFile).hexdigest()
print("Hash is: {}".format(file_hash)) print("Hash is: {}".format(file_hash))
print("Updating hash") print("Updating hash")
update_hash(file_hash) update_hash(file_hash)
subprocess.call(['git', 'add', '-u'])
subprocess.call(['git', 'commit', '-m', commitMessage])
subprocess.call(['git', 'tag', nextVersion])