Rich Enhanced Shell History - Contextual shell history for zsh and bash
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
resh/internal/deviceid/deviceid.go

18 lines
332 B

package deviceid
import (
"fmt"
"os"
"path"
"strings"
)
func Get(dataDir string) (string, error) {
fname := "device-id"
dat, err := os.ReadFile(path.Join(dataDir, fname))
if err != nil {
return "", fmt.Errorf("could not read file with device-id: %w", err)
}
id := strings.TrimRight(string(dat), "\n")
return id, nil
}