Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@chiarorosa
Copy link

Description

This PR simplifies read_configuration() in shared-functions.sh by replacing a complex sed regex with a clearer two-step parsing:
• Old: sed -r "s/^$name=(["']?)(.+)\1$/\2/"
• New: cut -d '=' -f2- | sed -r "s/^(["']?)(.+)\1$/\2/"

Why:

The new approach is easier to read and reason about while preserving behavior:
• Extracts the value after the first =
• Strips optional matching quotes around the value

Impact & Testing:

•	Functionality unchanged; continues to read values from overleaf.rc and remove surrounding quotes
•	Verified locally: function works as expected across typical configs
•	No breaking changes observed

Related issues / Pull Requests

•	Related to bin/up command (uses configuration parsing)

- Dockerfile: Custom Overleaf image with Portuguese LaTeX support
- .github/copilot-instructions.md: AI assistant instructions for the toolkit
- config/overleaf.rc: Custom configuration for UFPEL edition
Replace the complex sed regex with a simpler approach using cut -d '=' -f2-
to extract the value after the equals sign, followed by sed to remove quotes.

This makes the function more readable and potentially more robust.
These files belong to the custom-ufpel-edition branch and should not
be included in the PR for the read_configuration fix.
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.

1 participant