~poptart/x

ref: 53aeea2679f06c27229807cd53f43e3fa518358a x/cmd/uacmd.go -rw-r--r-- 519 bytes
53aeea26 — poptart Updated the UA to use the omahaproxy release info 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package main

import (
	"fmt"
	"git.sr.ht/~poptart/x/ua"
	"os"
)

func main() {
	if _, err := os.Stat(os.Getenv("HOME")+"/.config/hosaka_uacache"); err == nil {
		b, _ := useragent.GetUACache(os.Getenv("HOME")+"/.config/hosaka_uacache")
		fmt.Println(b.UserAgent)
	} else if os.IsNotExist(err) {
		e := useragent.SaveUACache(os.Getenv("HOME")+"/.config/hosaka_uacache")
		if e != nil {
			fmt.Println(e)
		}
		
		b, _ := useragent.GetUACache(os.Getenv("HOME")+"/.config/hosaka_uacache")
		fmt.Println(b.UserAgent)
	}
}