Use path instead of filepath for cross platform
parent
320b5cdb77
commit
1a38ef74b2
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue