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

Adjust software $json_data to match recent changes #339

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Conversation

Tearran
Copy link
Member

@Tearran Tearran commented Dec 25, 2024

Description

The idea from the start was to have one data entry point, the "Header". The active data array can be viewed with git repo or apt installed using the command: armbian-config --api generate_json_object

This PR is the first step towards producing a JSON object pipeline that will eventually replace the JSON file. By leveraging the already used module_option array and jq for querying, we aim to ensure consistency and eliminate the need to manually edit or source a separate file.

Many JSON keys are missing in the module_option array and cannot be parsed or queried. Leveraging jq can:

Changes Made

  • Added missing keys to the module_option array for better parsing and querying.
  • Updated the generate_json_data.sh script to properly handle the new keys and generate a valid JSON object.
  • Modified the config.runtime.sh module_options to remove unhandled escape sequences and quotes.

Goals and Impact

  • Eliminate the JSON editing and automate the UX.
  • Speed up the nesting that bash is unequipped for.
  • Handle real-time changes better than bash alone.
  • Ultimately ease automated and redundant tasks.
  • Improved loading times and nesting issue handling.
  • Better automation and less manual intervention required in JSON handling.
  • Enhanced user experience through jq optimization.

Testing

  • Verified that the updated ./bin/armbian-config --api set_json_options produces the correct JSON output.

Notes

  • armbian-config --api generate_json_options is out of date and needs updating.
  • The module_options array was lacking needed keys, and this PR addresses multiple issues such as loading times and nesting issues that bash is not meant to handle.

@github-actions github-actions bot added the size/large PR with 250 lines or more label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/large PR with 250 lines or more
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant