Skip to content

Commit

Permalink
fix: use path instead of filepath for asset embeds to support Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
aschmahmann committed May 5, 2022
1 parent b721255 commit 1299bcb
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions assets/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"io"
"io/fs"
"path/filepath"
gopath "path"
"strconv"

"github.com/ipfs/go-ipfs/core"
Expand All @@ -27,13 +27,13 @@ var AssetHash string

// initDocPaths lists the paths for the docs we want to seed during --init
var initDocPaths = []string{
filepath.Join("init-doc", "about"),
filepath.Join("init-doc", "readme"),
filepath.Join("init-doc", "help"),
filepath.Join("init-doc", "contact"),
filepath.Join("init-doc", "security-notes"),
filepath.Join("init-doc", "quick-start"),
filepath.Join("init-doc", "ping"),
gopath.Join("init-doc", "about"),
gopath.Join("init-doc", "readme"),
gopath.Join("init-doc", "help"),
gopath.Join("init-doc", "contact"),
gopath.Join("init-doc", "security-notes"),
gopath.Join("init-doc", "quick-start"),
gopath.Join("init-doc", "ping"),
}

func init() {
Expand Down Expand Up @@ -91,7 +91,7 @@ func addAssetList(nd *core.IpfsNode, l []string) (cid.Cid, error) {
return cid.Cid{}, err
}

fname := filepath.Base(p)
fname := gopath.Base(p)

basePath, err = api.Object().AddLink(nd.Context(), basePath, fname, fp)
if err != nil {
Expand Down

0 comments on commit 1299bcb

Please sign in to comment.