mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-26 06:52:23 +02:00
Make linux labeling more precise for AI completions
This commit is contained in:
parent
9b5a09f85e
commit
f4ee4e7175
@ -5,6 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"time"
|
||||
|
||||
@ -37,6 +38,15 @@ func GetAiSuggestions(ctx context.Context, query string, numberCompletions int)
|
||||
func getOsName() string {
|
||||
switch runtime.GOOS {
|
||||
case "linux":
|
||||
if _, err := exec.LookPath("apt-get"); err == nil {
|
||||
return "Ubuntu Linux"
|
||||
}
|
||||
if _, err := exec.LookPath("dnf"); err == nil {
|
||||
return "Fedora Linux"
|
||||
}
|
||||
if _, err := exec.LookPath("pacman"); err == nil {
|
||||
return "Arch Linux"
|
||||
}
|
||||
return "Linux"
|
||||
case "darwin":
|
||||
return "MacOS"
|
||||
|
Loading…
x
Reference in New Issue
Block a user