mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-26 15:02:00 +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"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"os/exec"
|
||||||
"runtime"
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -37,6 +38,15 @@ func GetAiSuggestions(ctx context.Context, query string, numberCompletions int)
|
|||||||
func getOsName() string {
|
func getOsName() string {
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "linux":
|
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"
|
return "Linux"
|
||||||
case "darwin":
|
case "darwin":
|
||||||
return "MacOS"
|
return "MacOS"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user