make path to atlas a variable

This commit is contained in:
Alex Tsernoh 2022-04-05 12:02:43 +01:00
parent 5108f7ff36
commit 8ed9659cdb
2 changed files with 11 additions and 2 deletions

View file

@ -9,4 +9,4 @@ jobs:
- name: Validate JSON
run: |
chmod +x ${{ github.workspace }}/tools/validate_json.py
python3 ${{ github.workspace }}/tools/validate_json.py
python3 ${{ github.workspace }}/tools/validate_json.py$ {{ github.workspace }}/web/atlas.json

View file

@ -1,5 +1,14 @@
#!/usr/bin/python
import sys
import json
json.load(open("./../web/atlas.json"))
path = "./../web/atlas.json"
# path override as 1st param: validate_json.py path_to_file.json
if (len(sys.argv) > 1):
path = sys.argv[1]
json.load(open(path))
print("JSON is valid")