Move code structure/overview to wiki

This commit is contained in:
the Sane.
2025-08-12 14:51:34 -04:00
committed by GitHub
parent cb52f608ae
commit 72b7755ff9

View File

@@ -9,7 +9,7 @@ With the above project goals in mind, please consider the following guidelines w
- Avoid overwhelming the user with choices and, instead, provide defaults that "Just Work". - Avoid overwhelming the user with choices and, instead, provide defaults that "Just Work".
- Any messages or options presented to the user should be clear and concise. - Any messages or options presented to the user should be clear and concise.
- The Helper should not make any changes to the user's system without first asking or notifying the user. - The Helper should not make any changes to the user's system without first asking or notifying the user.
- Avoid duplicating code. Make use of the existing helper functions. See [Code Structure and Overview](#code-structure-and-overview) below. - Avoid duplicating code. Make use of the existing helper functions. See [Code Structure and Overview](https://github.com/starcitizen-lug/lug-helper/wiki/Code-Structure-and-Overview).
### Code Syntax and Formatting Guidelines ### Code Syntax and Formatting Guidelines
- Match existing code styling and syntax for consistency and legibility. - Match existing code styling and syntax for consistency and legibility.
@@ -18,106 +18,3 @@ With the above project goals in mind, please consider the following guidelines w
- Where possible, code should be written to be easy to understand by someone who is moderately competent with shell script. - Where possible, code should be written to be easy to understand by someone who is moderately competent with shell script.
- Avoid overly simplified one-liners that are difficult to parse. Break it up. - Avoid overly simplified one-liners that are difficult to parse. Break it up.
- Please comment your code! - Please comment your code!
# Code Structure and Overview
What follows is a high level overview of the Helper's functions as of LUG Helper Version 4.3
## Setup
The setup portion at the top of the script:
- Performs dependency checks
- Initializes variables
- Sets configuration options for the rest of the script
## Helper abstractions
> [!note]
> These functions aim to provide easy access to actions frequently used by the Helper
#### Privilege escalation
* try_exec()
#### Messaging and menu building
* debug_print()
* message()
* progress_bar()
* menu()
* menu_loop_done()
#### Fetch and set directories used by the Helper and Star Citizen
* getdirs()
## Preflight Check Functions
> [!note]
> The preflight check is managed by one main function. It calls several auxiliary functions to perform its various actions
#### Main preflight check function
* preflight_check()
#### Auxiliary preflight check functions
* wine_check()
* memory_check()
* avx_check()
* mapcount_check()
* mapcount_set()
* mapcount_once()
* mapcount_confirm()
* filelimit_check()
* filelimit_set()
* filelimit_confirm()
## Download functions
> [!note]
> Downloads are managed by one main function and a secondary function for each download type. It calls several auxiliary functions to perform its various actions
#### Main download managers
* download_manage()
* runner_manage_wine()
#### Auxiliary download functions
* download_select_install()
* download_install()
* download_select_delete()
* download_delete()
* post_download()
* download_file()
* lutris_restart()
* download_file()
## Maintenance menu functions
> [!note]
> The maintenance menu is managed by one main function. It calls several auxiliary functions to perform its various actions
#### Main maintenance menu
* maintenance_menu()
#### Auxiliary maintenance functions
* switch_prefix()
* update_launcher()
* call_launch_script()
* edit_wine_launch_script()
* display_dirs()
* display_wiki()
* reset_helper()
## Install functions
> [!note]
> These functions handle game installation
* install_game_wine()
* download_wine()
* download_winetricks()
* install_powershell()
* dxvk_update_wine()
## Helper helper functions
> [!note]
> These helper functions perform actions needed by the Helper
* format_urls()
* get_latest_release()
* referral_randomizer()
* quit()
## Main
> [!note]
> The main logic of the script begins after all the functions are declared