Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consolidate.py: make a scripts index file #6

Merged
merged 1 commit into from Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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)