shithub: hugo

Download patch

ref: 99463f6adf73b63e98350240d73cab116bcbb704
parent: 2c51bba0c30fd33252f7832c12aec5eb8cb35a20
author: Joel Scoble <[email protected]>
date: Thu Nov 6 05:56:14 EST 2014

converted path 2 filepath

--- a/commands/convert.go
+++ b/commands/convert.go
@@ -15,7 +15,7 @@
 
 import (
 	"fmt"
-	"path"
+	"path/filepath"
 	"time"
 
 	"github.com/spf13/cast"
@@ -133,7 +133,7 @@
 		page.SetSourceMetaData(metadata, mark)
 
 		if OutputDir != "" {
-			page.SaveSourceAs(path.Join(OutputDir, page.FullFilePath()))
+			page.SaveSourceAs(filepath.Join(OutputDir, page.FullFilePath()))
 		} else {
 			if Unsafe {
 				page.SaveSource()
--- a/commands/new.go
+++ b/commands/new.go
@@ -14,7 +14,6 @@
 import (
 	"bytes"
 	"os"
-	"path"
 	"path/filepath"
 	"strings"
 
@@ -141,7 +140,7 @@
 		jww.FATAL.Fatalln("theme name needs to be provided")
 	}
 
-	createpath := helpers.AbsPathify(path.Join("themes", args[0]))
+	createpath := helpers.AbsPathify(filepath.Join("themes", args[0]))
 	jww.INFO.Println("creating theme at", createpath)
 
 	if x, _ := helpers.Exists(createpath, hugofs.SourceFs); x {
@@ -186,7 +185,7 @@
 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 `)
 
-	err := helpers.WriteToDisk(path.Join(createpath, "LICENSE.md"), bytes.NewReader(by), hugofs.SourceFs)
+	err := helpers.WriteToDisk(filepath.Join(createpath, "LICENSE.md"), bytes.NewReader(by), hugofs.SourceFs)
 	if err != nil {
 		jww.FATAL.Fatalln(err)
 	}
@@ -195,7 +194,7 @@
 }
 
 func mkdir(x ...string) {
-	p := path.Join(x...)
+	p := filepath.Join(x...)
 
 	err := os.MkdirAll(p, 0777) // rwx, rw, r
 	if err != nil {
@@ -204,7 +203,7 @@
 }
 
 func touchFile(x ...string) {
-	inpath := path.Join(x...)
+	inpath := filepath.Join(x...)
 	mkdir(filepath.Dir(inpath))
 	err := helpers.WriteToDisk(inpath, bytes.NewReader([]byte{}), hugofs.SourceFs)
 	if err != nil {
@@ -228,7 +227,7 @@
 		return err
 	}
 
-	err = helpers.WriteToDisk(path.Join(inpath, "theme.toml"), bytes.NewReader(by), hugofs.SourceFs)
+	err = helpers.WriteToDisk(filepath.Join(inpath, "theme.toml"), bytes.NewReader(by), hugofs.SourceFs)
 	if err != nil {
 		return
 	}
@@ -245,7 +244,7 @@
 		return err
 	}
 
-	err = helpers.WriteToDisk(path.Join(inpath, "config."+kind), bytes.NewReader(by), hugofs.SourceFs)
+	err = helpers.WriteToDisk(filepath.Join(inpath, "config."+kind), bytes.NewReader(by), hugofs.SourceFs)
 	if err != nil {
 		return
 	}
--- a/commands/version.go
+++ b/commands/version.go
@@ -16,7 +16,6 @@
 import (
 	"fmt"
 	"os"
-	"path"
 	"path/filepath"
 	"strings"
 	"time"
@@ -65,7 +64,7 @@
 		fmt.Println(err)
 		return
 	}
-	fi, err := os.Lstat(path.Join(dir, "hugo"))
+	fi, err := os.Lstat(filepath.Join(dir, "hugo"))
 	if err != nil {
 		fmt.Println(err)
 		return