Skip to content

Commit

Permalink
use os.TmpDir() to get temporary files dir
Browse files Browse the repository at this point in the history
  • Loading branch information
0pcom committed Jan 31, 2024
1 parent d990dae commit 1b89650
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 42 deletions.
4 changes: 2 additions & 2 deletions cmd/skywire-cli/commands/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ func init() {
listCmd.Flags().StringVarP(&sdURL, "sdurl", "a", skyenv.ServiceDiscAddr, "service discovery url")
listCmd.Flags().BoolVarP(&rawData, "raw", "r", false, "print raw data")
listCmd.Flags().BoolVarP(&noFilterOnline, "noton", "o", false, "do not filter by online status in UT")
listCmd.Flags().StringVar(&cacheFileSD, "cfs", "/tmp/proxysd.json", "SD cache file location")
listCmd.Flags().StringVar(&cacheFileUT, "cfu", "/tmp/ut.json", "UT cache file location.")
listCmd.Flags().StringVar(&cacheFileSD, "cfs", os.TempDir()+"/proxysd.json", "SD cache file location")
listCmd.Flags().StringVar(&cacheFileUT, "cfu", os.TempDir()+"/ut.json", "UT cache file location.")
listCmd.Flags().IntVarP(&cacheFilesAge, "cfa", "m", 5, "update cache files if older than n minutes")
listCmd.Flags().StringVarP(&pk, "pk", "k", "", "check "+serviceType+" service discovery for public key")
listCmd.Flags().BoolVarP(&isUnFiltered, "unfilter", "u", false, "provide unfiltered results")
Expand Down
40 changes: 20 additions & 20 deletions cmd/skywire-cli/commands/proxy/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ import (
)

var (
version = buildinfo.Version()
binaryName = "skysocks-client"
stateName = "skysocks-client"
serviceType = servicedisc.ServiceTypeProxy
isUnFiltered bool
rawData bool
utURL string
sdURL string
cacheFileSD string
cacheFileUT string
cacheFilesAge int
ver string
country string
isStats bool
pubkey cipher.PubKey
pk string
allClients bool
noFilterOnline bool
clientName string
addr string
version = buildinfo.Version()
binaryName = "skysocks-client"
stateName = "skysocks-client"
serviceType = servicedisc.ServiceTypeProxy
isUnFiltered bool
rawData bool
utURL string
sdURL string
cacheFileSD string
cacheFileUT string
cacheFilesAge int
ver string
country string
isStats bool
pubkey cipher.PubKey
pk string
allClients bool
noFilterOnline bool
clientName string
addr string
startingTimeout int
)

Expand Down
36 changes: 18 additions & 18 deletions cmd/skywire-cli/commands/vpn/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@ import (
)

var (
version = buildinfo.Version()
stateName = "vpn-client"
serviceType = servicedisc.ServiceTypeVPN
isUnFiltered bool
rawData bool
utURL string
sdURL string
cacheFileSD string
cacheFileUT string
cacheFilesAge int
noFilterOnline bool
path string
isPkg bool
ver string
country string
isStats bool
pubkey cipher.PubKey
pk string
version = buildinfo.Version()
stateName = "vpn-client"
serviceType = servicedisc.ServiceTypeVPN
isUnFiltered bool
rawData bool
utURL string
sdURL string
cacheFileSD string
cacheFileUT string
cacheFilesAge int
noFilterOnline bool
path string
isPkg bool
ver string
country string
isStats bool
pubkey cipher.PubKey
pk string
startingTimeout int
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/skywire-cli/commands/vpn/vvpn.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ func init() {
listCmd.Flags().StringVarP(&sdURL, "sdurl", "a", skyenv.ServiceDiscAddr, "service discovery url")
listCmd.Flags().BoolVarP(&rawData, "raw", "r", false, "print raw data")
listCmd.Flags().BoolVarP(&noFilterOnline, "noton", "o", false, "do not filter by online status in UT")
listCmd.Flags().StringVar(&cacheFileSD, "cfs", "/tmp/vpnsd.json", "SD cache file location")
listCmd.Flags().StringVar(&cacheFileUT, "cfu", "/tmp/ut.json", "UT cache file location.")
listCmd.Flags().StringVar(&cacheFileSD, "cfs", os.TempDir()+"/vpnsd.json", "SD cache file location")
listCmd.Flags().StringVar(&cacheFileUT, "cfu", os.TempDir()+"/ut.json", "UT cache file location.")
listCmd.Flags().IntVarP(&cacheFilesAge, "cfa", "m", 5, "update cache files if older than n minutes")
listCmd.Flags().StringVarP(&pk, "pk", "k", "", "check "+serviceType+" service discovery for public key")
listCmd.Flags().BoolVarP(&isUnFiltered, "unfilter", "u", false, "provide unfiltered results")
Expand Down

0 comments on commit 1b89650

Please sign in to comment.