From 8ed9659cdb7af2e74a0a64a4c28c8faa16c9fe05 Mon Sep 17 00:00:00 2001 From: Alex Tsernoh Date: Tue, 5 Apr 2022 12:02:43 +0100 Subject: [PATCH] make path to atlas a variable --- .github/workflows/github-actions.yml | 2 +- tools/validate_json.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 252f2c1f..495a05ad 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -9,4 +9,4 @@ jobs: - name: Validate JSON run: | chmod +x ${{ github.workspace }}/tools/validate_json.py - python3 ${{ github.workspace }}/tools/validate_json.py \ No newline at end of file + python3 ${{ github.workspace }}/tools/validate_json.py$ {{ github.workspace }}/web/atlas.json \ No newline at end of file diff --git a/tools/validate_json.py b/tools/validate_json.py index e7bcac32..64e5b7c8 100644 --- a/tools/validate_json.py +++ b/tools/validate_json.py @@ -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") \ No newline at end of file