Merge pull request #674 from cyian-1756/patchScriptFixes

patch.py now commits change to currentHash
This commit is contained in:
Kevin Jiang 2018-06-07 20:58:29 -04:00 committed by GitHub
commit 7df4c7b296
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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")
@ -85,4 +85,7 @@ readFile = openedFile.read()
file_hash = sha256(readFile).hexdigest() 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])