Skip to content

Commit

Permalink
add get osrelease function
Browse files Browse the repository at this point in the history
  • Loading branch information
LinkLeong committed Jan 25, 2024
1 parent 82465b1 commit be31cce
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions utils/idevice/os_release.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package idevice

import (
"github.com/IceWhaleTech/CasaOS-Common/utils/file"
)

func GetOSRelease(name []string) (map[string]string, error) {
osRelease, err := file.ReadOSRelease()
if err != nil {
return nil, err
}
data := make(map[string]string)
if len(name) == 0 {
return osRelease, nil
}
for _, v := range name {
data[v] = osRelease[v]
}
return data, nil
}

0 comments on commit be31cce

Please sign in to comment.