From 804a25979e5fac2e71db8b70858e88fea5416310 Mon Sep 17 00:00:00 2001 From: rpriven Date: Mon, 22 Sep 2025 22:44:35 -0600 Subject: [PATCH] Fix: Resolve readonly variable conflict in system detection --- README.md | 3 ++- fresh.sh | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 43932b7..584126c 100644 --- a/README.md +++ b/README.md @@ -183,10 +183,11 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file ## 🙏 Acknowledgments +- Thank you to Daniel Miessler for building and open-sourcing PAI (https://github.com/danielmiessler/PAI) - Built for modern Linux productivity workflows - Inspired by the need for consistent, reproducible development environments - Integrates the best modern CLI tools available --- -**Fresh** - Because every new system deserves a fresh start with the right tools. 🚀 \ No newline at end of file +**Fresh** - Because every new system deserves a fresh start with the right tools. 🚀 diff --git a/fresh.sh b/fresh.sh index 3d907d6..a14e9c9 100755 --- a/fresh.sh +++ b/fresh.sh @@ -119,9 +119,11 @@ detect_system() { log "Detecting system information..." if [[ -f /etc/os-release ]]; then - source /etc/os-release - echo "OS: $PRETTY_NAME" - echo "Version: $VERSION_ID" + # Read OS info safely without sourcing to avoid readonly variable conflicts + local os_name=$(grep '^PRETTY_NAME=' /etc/os-release | cut -d'"' -f2) + local os_version=$(grep '^VERSION_ID=' /etc/os-release | cut -d'"' -f2) + echo "OS: ${os_name:-Unknown}" + echo "Version: ${os_version:-Unknown}" fi echo "Architecture: $(uname -m)"