mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-01-07 23:55:15 +08:00
fix: Correctly trim parentheses from detected Linux distribution name in GetDistro method
This commit is contained in:
parent
2e56c05c0d
commit
5548651615
1 changed files with 2 additions and 2 deletions
|
|
@ -43,8 +43,8 @@ func (h *HostInfoState) GetHostInfo(forceRefresh bool) (*host.InfoStat, error) {
|
|||
func (h *HostInfoState) GetDistro() string {
|
||||
if h.cachedDistro == "" {
|
||||
d := detectLinuxDistro()
|
||||
if strings.HasSuffix(d, "(") {
|
||||
d = d[:strings.Index(d, "(")]
|
||||
if strings.Contains(d, "(") && strings.Contains(d, ")") {
|
||||
d = d[:strings.LastIndex(d, "(")]
|
||||
}
|
||||
h.cachedDistro = strings.TrimSpace(d)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue