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

feat(dev): add new developer command for parsing distro details #4523

Merged

Conversation

MicLieg
Copy link
Contributor

@MicLieg MicLieg commented Mar 4, 2024

Description

Parse Game Details

  • This PR renames command_dev_details.sh to command_dev_parse_game_details.sh to better reflect the purpose of the command.
  • Now every variable that info_game.sh can provide will be displayed if set.
  • The advantage is that no matter what gameserver is currently installed the command ./gameserver parse-game-details will display every variable that LinuxGSM (info_game.sh) could parse from the games config file.
    K8s6GnfbA1

Parse Distro Details

  • This PR adds a new command, similar to command_dev_parse_game_details.sh, which will display every set variable that info_distro.sh can provide (with a few exceptions).
    RDh4p9Z0eb

Fixes N/A

Type of change

  • Bug fix (a change which fixes an issue).
  • New feature (a change which adds functionality).
  • New Server (new server added).
  • Refactor (restructures existing code).
  • Comment update (typo, spelling, explanation, examples, etc).

Checklist

PR will not be merged until all steps are complete.

  • This pull request links to an issue.
  • This pull request uses the develop branch as its base.
  • This pull request subject follows the Conventional Commits standard.
  • This code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • I have checked that this code is commented where required.
  • I have provided a detailed enough description of this PR.
  • I have checked if documentation needs updating.
    • I will add documentation once I get feedback on whether this PR will be merged.

Documentation

If documentation does need updating either update it by creating a PR (preferred) or request a documentation update.

Thank you for your Pull Request!

Copy link
Member

@dgibbs64 dgibbs64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line need updating.

run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server detect-details

Also please make sure you update the required docs.

Apart from that I like the update. Thank you

@dgibbs64 dgibbs64 added this to the v24.2.0 milestone Mar 8, 2024
@MicLieg
Copy link
Contributor Author

MicLieg commented Mar 8, 2024

You're absolutley right! I didn't think of that.

I'll submit a PR for the docs in a couple of hours tomorrow 👍

@dgibbs64 dgibbs64 merged commit 9b62bde into GameServerManagers:develop Mar 9, 2024
3 checks passed
@MicLieg
Copy link
Contributor Author

MicLieg commented Mar 9, 2024

FYI, I'm going to keep the new documentation for this to a minimum for now, and expand it as soon as #4527 and the other two doc PRs are merged.

After that i'm planning to give all the docs some attention and will be refactoring them quite a bit.

@MicLieg
Copy link
Contributor Author

MicLieg commented Jun 27, 2024

This comment was posted to the wrong PR:

For archiving purposes, I'm posting the script I used to extract most of the variables:

#!/bin/bash

# Define the root directory to search in
ROOT_DIR="./lgsm/modules"

# Find all .sh files and process them
find "$ROOT_DIR" -type f -name "*.sh" | while read -r file; do
    echo "File: $file"
    # Extract variables, including those using += for appending
    # Remove duplicates in the same file, ignoring comments
    # and focusing on simple VARIABLE=value or VARIABLE+=value patterns
    # without the value, =, or + character
    grep -Eo '^[[:space:]]*[^#[:space:]]+\+?=[^=]+' "$file" | \
    sed -E 's/\+?=.*//' | \
    sort | uniq | \
    sort | \
    while read -r variable; do
        echo "  - $variable"
    done
    echo # Add a blank line for better readability between files
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants