Skip to content

Commit

Permalink
consolidate.py: make a scripts index file
Browse files Browse the repository at this point in the history
  • Loading branch information
Williangalvani authored and patrickelectric committed Mar 26, 2024
1 parent 78c90fa commit 6e38d95
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Expand Up @@ -21,6 +21,7 @@ jobs:
python consolidate.py
mkdir build
mv params* build/
mv scripts* build/
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
Expand Down
16 changes: 16 additions & 0 deletions consolidate.py
Expand Up @@ -97,3 +97,19 @@ def sanitize_key(key):
# Save the json_data to a JSON file
with open('params_v1.json', 'w') as json_file:
json.dump(json_data, json_file, indent=4)


# Now let's do scripts
# Start at the root directory and walk the directory tree
root_directory = os.getcwd() # Get current directory
files = []
for dirpath, dirnames, filenames in os.walk(root_directory):
for filename in filenames:
if filename.endswith('.lua'):
file_path = os.path.join(dirpath, filename)
relative_path = os.path.relpath(file_path, root_directory)
files.append(relative_path)

# Save the json_data to a JSON file
with open('scripts_v1.json', 'w') as json_file:
json.dump(files, json_file, indent=4)

0 comments on commit 6e38d95

Please sign in to comment.