[PR #10116] [MERGED] tools.func: hardening/Improve error handling and cleanup in shell functions #8397

Closed
opened 2026-02-05 08:29:26 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE/pull/10116
Author: @MickLesk
Created: 12/18/2025
Status: Merged
Merged: 12/18/2025
Merged by: @CrazyWolf13

Base: mainHead: hardening_tools.func


📝 Commits (1)

  • 8c0319a Improve error handling and cleanup in shell functions

📊 Changes

2 files changed (+14 additions, -16 deletions)

View changed files

📝 misc/core.func (+3 -5)
📝 misc/tools.func (+11 -11)

📄 Description

✍️ Description

Refactored various shell functions to add more robust error handling by redirecting stderr to /dev/null and using '|| true' to prevent script failures. Enhanced npm cache cleanup to remove both _cacache and _logs directories, and improved reliability of version and keyring extraction commands. These changes increase script resilience and prevent unnecessary errors from halting execution.

Fixes #

Prerequisites (X in brackets)

  • Self-review completed – Code follows project standards.
  • Tested thoroughly – Changes work as expected.
  • No security risks – No hardcoded secrets, unnecessary privilege escalations, or permission issues.

🛠️ Type of Change (X in brackets)

  • 🐞 Bug fix – Resolves an issue without breaking functionality.
  • New feature – Adds new, non-breaking functionality.
  • 💥 Breaking change – Alters existing functionality in a way that may require updates.
  • 🆕 New script – A fully functional and tested script or script set.
  • 🌍 Website update – Changes to website-related JSON files or metadata.
  • 🔧 Refactoring / Code Cleanup – Improves readability or maintainability without changing functionality.
  • 📝 Documentation update – Changes to README, AppName.md, CONTRIBUTING.md, or other docs.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/community-scripts/ProxmoxVE/pull/10116 **Author:** [@MickLesk](https://github.com/MickLesk) **Created:** 12/18/2025 **Status:** ✅ Merged **Merged:** 12/18/2025 **Merged by:** [@CrazyWolf13](https://github.com/CrazyWolf13) **Base:** `main` ← **Head:** `hardening_tools.func` --- ### 📝 Commits (1) - [`8c0319a`](https://github.com/community-scripts/ProxmoxVE/commit/8c0319a42bf269fd15fcd90e2883b9c1c08581cd) Improve error handling and cleanup in shell functions ### 📊 Changes **2 files changed** (+14 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `misc/core.func` (+3 -5) 📝 `misc/tools.func` (+11 -11) </details> ### 📄 Description <!--🛑 New scripts must be submitted to [ProxmoxVED](https://github.com/community-scripts/ProxmoxVED) for testing. PRs without prior testing will be closed. --> ## ✍️ Description Refactored various shell functions to add more robust error handling by redirecting stderr to /dev/null and using '|| true' to prevent script failures. Enhanced npm cache cleanup to remove both _cacache and _logs directories, and improved reliability of version and keyring extraction commands. These changes increase script resilience and prevent unnecessary errors from halting execution. ## 🔗 Related Issue Fixes # ## ✅ Prerequisites (**X** in brackets) - [x] **Self-review completed** – Code follows project standards. - [x] **Tested thoroughly** – Changes work as expected. - [x] **No security risks** – No hardcoded secrets, unnecessary privilege escalations, or permission issues. --- ## 🛠️ Type of Change (**X** in brackets) - [ ] 🐞 **Bug fix** – Resolves an issue without breaking functionality. - [ ] ✨ **New feature** – Adds new, non-breaking functionality. - [ ] 💥 **Breaking change** – Alters existing functionality in a way that may require updates. - [ ] 🆕 **New script** – A fully functional and tested script or script set. - [ ] 🌍 **Website update** – Changes to website-related JSON files or metadata. - [x] 🔧 **Refactoring / Code Cleanup** – Improves readability or maintainability without changing functionality. - [ ] 📝 **Documentation update** – Changes to `README`, `AppName.md`, `CONTRIBUTING.md`, or other docs. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 08:29:26 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ProxmoxVE#8397