From: Bjørn Erik Pedersen Date: Sun, 7 Feb 2016 01:12:33 +0000 (+0100) Subject: Use filepath.Join in locale resource getting X-Git-Tag: v0.16~361 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0586bf0dc3c65c040f7fde2379e9edf4dc8fb90d;p=brevno-suite%2Fhugo Use filepath.Join in locale resource getting --- diff --git a/tpl/template_resources.go b/tpl/template_resources.go index 30c7f589..204c0f39 100644 --- a/tpl/template_resources.go +++ b/tpl/template_resources.go @@ -158,15 +158,7 @@ func resGetRemote(url string, fs afero.Fs, hc *http.Client) ([]byte, error) { // resGetLocal loads the content of a local file func resGetLocal(url string, fs afero.Fs) ([]byte, error) { - p := "" - workingDir := viper.GetString("WorkingDir") - if workingDir != "" { - p = workingDir - if !strings.HasSuffix(p, helpers.FilePathSeparator) { - p = p + helpers.FilePathSeparator - } - } - filename := p + url + filename := filepath.Join(viper.GetString("WorkingDir"), url) if e, err := helpers.Exists(filename, fs); !e { return nil, err }