Skip to content

Commit

Permalink
proper homedir
Browse files Browse the repository at this point in the history
  • Loading branch information
zgiles committed Mar 8, 2020
1 parent f16f9c9 commit 5154b55
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,11 @@ func main() {
rscfiles := []string{}
localdir := "."
if runtime.GOOS == "darwin" {
localdir = "~/Downloads"
homedir, err := os.UserHomeDir()
if err != nil {
log.Fatal(err)
}
localdir = filepath.Join(homedir, "Downloads")
}
localfiles, _ := ioutil.ReadDir(localdir)
for _, file := range localfiles {
Expand Down

0 comments on commit 5154b55

Please sign in to comment.