diff --git a/README.md b/README.md index 886a654..d07a008 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -FileDelta v0.2.0 +FileDelta v0.3.0 ================ 1. Calculates the SHA-256 hash of a file diff --git a/main.go b/main.go index d300311..cb2e644 100644 --- a/main.go +++ b/main.go @@ -13,6 +13,7 @@ import ( "io/ioutil" "net/url" "os" + "path/filepath" homedir "github.com/mitchellh/go-homedir" ) @@ -23,7 +24,7 @@ import ( const ( AppDesc AppMetaData = "File change detection tool" AppName AppMetaData = "FileDelta" - AppVersion AppMetaData = "0.2.0" + AppVersion AppMetaData = "0.3.0" CLIName AppMetaData = "filedelta" CommandCheck = "check" CommandStore = "store" @@ -73,6 +74,10 @@ var ( * FUNCTIONS */ func cacheFilePath(file string) string { + fileAbs, err := filepath.Abs(file) + if err == nil { + file = fileAbs + } return fmt.Sprintf("%s/%s", cachePath, url.QueryEscape(file)) }