From 9c8a39fe319047261169aa9222e3499abb15a85d Mon Sep 17 00:00:00 2001 From: threeoh6000 Date: Wed, 13 Nov 2024 16:06:10 +0000 Subject: [PATCH] cygwin has issues --- README.md | 2 +- distro_machine_detection.7 | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a412222..ab7f174 100644 --- a/README.md +++ b/README.md @@ -16,4 +16,4 @@ abbiefetch will attempt to gather as much information as possible on systems tha | `freebsd` | FreeBSD | | 1.1.0 | Full | | | `haiku` | Haiku | | 1.1.0 | Limited | | | `windows` | Microsoft Windows | | 1.2.0 | Full | Relies on wmic.exe and systeminfo.exe | -| `windows/cygwin` | Microsoft Windows | Cygwin | 1.2.0 | Full | Relies on wmic.exe and systeminfo.exe | +| `windows/cygwin` | Microsoft Windows | Cygwin | 1.2.0 | Partial | Relies on wmic.exe and systeminfo.exe, issues with machine detection | diff --git a/distro_machine_detection.7 b/distro_machine_detection.7 index 2b3345b..28e3602 100644 --- a/distro_machine_detection.7 +++ b/distro_machine_detection.7 @@ -72,5 +72,9 @@ if [ "$system_type" = "windows" ] && [ -z "$machine"] && [ "$hassed" -eq 1 ]; th if [ "$hasawk" -eq 1 ]; then distro="$(systeminfo.exe 2>/dev/null | grep -v "BIOS" | grep "OS Version" | awk -F ":" '{print $2}' | tr -s " ")" fi - machine="$(wmic.exe computersystem get Manufacturer | sed -n 2p | head -n 1 | tr -s " ")$(wmic.exe computersystem get Model | sed -n 2p | head -n 1)" + if [ "$subtype" = "cygwin" ]; then + machine=0 + else + machine="$(wmic.exe computersystem get Manufacturer | sed -n 2p | head -n 1 | tr -s " ")$(wmic.exe computersystem get Model | sed -n 2p | head -n 1)" + fi fi