Skip to content

Commit

Permalink
Check if file size is 0 for #105 (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
pbek authored and knqyf263 committed Aug 3, 2019
1 parent cb749ab commit d5aa0ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sync/sync.go
Expand Up @@ -36,7 +36,7 @@ func AutoSync(file string) error {
}

fi, err := os.Stat(file)
if os.IsNotExist(err) {
if os.IsNotExist(err) || fi.Size() == 0 {
return download(snippet.Content)
} else if err != nil {
return errors.Wrap(err, "Failed to get a FileInfo")
Expand Down

0 comments on commit d5aa0ab

Please sign in to comment.