revised/improved logic in .bashrc for memory and system updates.#70
revised/improved logic in .bashrc for memory and system updates.#70
Conversation
Updated version number and changelog for du_setup.sh.
There was a problem hiding this comment.
Pull Request Overview
This PR updates the script to version 0.72.1, improving the memory display formatting and enhancing the robustness of the system updates detection logic in the .bashrc configuration.
Key changes:
- Enhanced memory display to show values in appropriate units (MiB/GiB) with proper formatting
- Improved system updates detection with better fallback mechanisms and error handling
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| du_setup.sh | Updated version to 0.72.1, improved memory display formatting with unit conversion, and enhanced update detection logic with multiple fallback strategies |
| du_setup.sh.sha256 | Updated checksum to reflect changes in du_setup.sh |
| README.md | Updated version number, date, and checksum references to match the new release |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| # Fallback if apt-check didn't provide values | ||
| if [ -z "$total" ] && [ -r /var/lib/update-notifier/updates-available ]; then | ||
| total=$(awk '/[0-9]+ (update|package)s? can be (updated|applied|installed)/ {print $1; exit}' /var/lib/update-notifier/updates-available 2>/dev/null) |
There was a problem hiding this comment.
The regex pattern (update|package)s? will match 'updates' or 'packages' but the s? only applies to the closing word. The pattern should be (updates?|packages?) to correctly match both singular and plural forms of both words.
| total=$(awk '/[0-9]+ (update|package)s? can be (updated|applied|installed)/ {print $1; exit}' /var/lib/update-notifier/updates-available 2>/dev/null) | |
| total=$(awk '/[0-9]+ (updates?|packages?) can be (updated|applied|installed)/ {print $1; exit}' /var/lib/update-notifier/updates-available 2>/dev/null) |
| total=$(awk '/[0-9]+ (update|package)s? can be (updated|applied|installed)/ {print $1; exit}' /var/lib/update-notifier/updates-available 2>/dev/null) | ||
| security=$(awk '/[0-9]+ (update|package)s? .*security/ {print $1; exit}' /var/lib/update-notifier/updates-available 2>/dev/null) |
There was a problem hiding this comment.
The regex pattern (update|package)s? will match 'updates' or 'packages' but the s? only applies to the closing word. The pattern should be (updates?|packages?) to correctly match both singular and plural forms of both words.
| total=$(awk '/[0-9]+ (update|package)s? can be (updated|applied|installed)/ {print $1; exit}' /var/lib/update-notifier/updates-available 2>/dev/null) | |
| security=$(awk '/[0-9]+ (update|package)s? .*security/ {print $1; exit}' /var/lib/update-notifier/updates-available 2>/dev/null) | |
| total=$(awk '/[0-9]+ (updates?|packages?) can be (updated|applied|installed)/ {print $1; exit}' /var/lib/update-notifier/updates-available 2>/dev/null) | |
| security=$(awk '/[0-9]+ (updates?|packages?) .*security/ {print $1; exit}' /var/lib/update-notifier/updates-available 2>/dev/null) |
update codcy in patch
Removed the check for non-UTF-8 files from the workflow.
Added a step to sanitize non-UTF-8 files before running Codacy Analysis CLI.
Updated Codacy workflow to improve security scanning and file handling.
No description provided.