converted path 2 filepath
authorJoel Scoble <joel.scoble@outlook.com>
Thu, 6 Nov 2014 16:56:14 +0000 (10:56 -0600)
committerspf13 <steve.francia@gmail.com>
Fri, 14 Nov 2014 03:39:07 +0000 (22:39 -0500)
commands/convert.go
commands/new.go
commands/version.go

index 434c6896f84ae254ce5bf7d7e4a9aa29746496e4..2aa6da9ddcbe48d7631bff90463a179815c7b2a6 100644 (file)
@@ -15,7 +15,7 @@ package commands
 
 import (
        "fmt"
-       "path"
+       "path/filepath"
        "time"
 
        "github.com/spf13/cast"
@@ -133,7 +133,7 @@ func convertContents(mark rune) (err error) {
                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()
index 4fc566b4fa20048395f7eb5f9082717b6eeae987..4a6e1d278b9a5334e593dc96fca1686291efe29b 100644 (file)
@@ -14,7 +14,6 @@ package commands
 import (
        "bytes"
        "os"
-       "path"
        "path/filepath"
        "strings"
 
@@ -141,7 +140,7 @@ func NewTheme(cmd *cobra.Command, args []string) {
                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 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 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 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 }
 
 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 mkdir(x ...string) {
 }
 
 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 @@ func createThemeMD(inpath string) (err error) {
                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 @@ func createConfig(inpath string, kind string) (err error) {
                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
        }
index 0ce73c4d690c4930ca3f40be2da4d816c7fc0ba2..3d1b2b06919fd6454e7eaa51722c51286f8d7ec7 100644 (file)
@@ -16,7 +16,6 @@ package commands
 import (
        "fmt"
        "os"
-       "path"
        "path/filepath"
        "strings"
        "time"
@@ -65,7 +64,7 @@ func setBuildDate() {
                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