Use path instead of filepath for cross platform

pull/2052/head
Matt Rickard 2017-10-11 14:26:42 -07:00
parent 320b5cdb77
commit 1a38ef74b2
2 changed files with 4 additions and 4 deletions

View File

@ -20,7 +20,7 @@ import (
"bytes"
"io"
"os"
"path/filepath"
"path"
"github.com/pkg/errors"
)
@ -65,7 +65,7 @@ type FileAsset struct {
}
func NewMemoryAssetTarget(d []byte, targetPath, permissions string) *MemoryAsset {
return NewMemoryAsset(d, filepath.Dir(targetPath), filepath.Base(targetPath), permissions)
return NewMemoryAsset(d, path.Dir(targetPath), path.Base(targetPath), permissions)
}
func NewFileAsset(assetName, targetDir, targetName, permissions string) (*FileAsset, error) {

View File

@ -21,7 +21,7 @@ import (
"crypto"
"fmt"
"os"
"path/filepath"
"path"
"strings"
"time"
@ -361,7 +361,7 @@ func generateConfig(k8s bootstrapper.KubernetesConfig) (string, error) {
func maybeDownloadAndCache(binary, version string) (string, error) {
targetDir := constants.MakeMiniPath("cache", version)
targetFilepath := filepath.Join(targetDir, binary)
targetFilepath := path.Join(targetDir, binary)
_, err := os.Stat(targetFilepath)
// If it exists, do no verification and continue