Added missing root folder check in trainer battle type migration script (#6944)
This commit is contained in:
parent
35a7caa682
commit
942a533ea1
@ -1,4 +1,5 @@
|
|||||||
import re
|
import re
|
||||||
|
import os
|
||||||
|
|
||||||
def trainer_battle_types(data):
|
def trainer_battle_types(data):
|
||||||
data = re.sub(re.escape("Double Battle: No"), "Battle Type: Singles", data)
|
data = re.sub(re.escape("Double Battle: No"), "Battle Type: Singles", data)
|
||||||
@ -6,6 +7,10 @@ def trainer_battle_types(data):
|
|||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
if not os.path.exists("Makefile"):
|
||||||
|
print("Please run this script from your root folder.")
|
||||||
|
quit()
|
||||||
|
|
||||||
with open('src/data/trainers.party', 'r') as file:
|
with open('src/data/trainers.party', 'r') as file:
|
||||||
data = file.read()
|
data = file.read()
|
||||||
with open('src/data/trainers.party', 'w') as file:
|
with open('src/data/trainers.party', 'w') as file:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user