Add path check for offset json
This commit is contained in:
@@ -2,10 +2,17 @@ import sys
|
|||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
|
import os
|
||||||
|
|
||||||
source_url = "https://raw.githubusercontent.com/a2x/cs2-dumper/main/output/offsets.json"
|
source_url = "https://raw.githubusercontent.com/a2x/cs2-dumper/main/output/offsets.json"
|
||||||
commits_url = "https://api.github.com/repos/a2x/cs2-dumper/commits"
|
commits_url = "https://api.github.com/repos/a2x/cs2-dumper/commits"
|
||||||
|
if os.path.isfile("./offsets/offsets.json"):
|
||||||
dest_path = "./offsets/offsets.json"
|
dest_path = "./offsets/offsets.json"
|
||||||
|
elif os.path.isfile("./offsets.json"):
|
||||||
|
dest_path = "./offsets.json"
|
||||||
|
else:
|
||||||
|
print("Invalid path for 'offsets.json'")
|
||||||
|
exit()
|
||||||
|
|
||||||
# Fetch the source JSON
|
# Fetch the source JSON
|
||||||
source_response = requests.get(source_url)
|
source_response = requests.get(source_url)
|
||||||
|
|||||||
Reference in New Issue
Block a user