whyrusleeping / gx-go

gx subtool for golang
MIT License
80 stars 28 forks source link

How to link to a package without a package.json file? #53

Open rob-deutsch opened 5 years ago

rob-deutsch commented 5 years ago

Okay, so I'm a bit confused. I am hacking on go-ipfs and I want to link to a package called "fuse".

go-ipfs' package.json shows the following entry:

    {
      "author": "kubuxu",
      "hash": "QmSJBsmLP1XMjv8hxYg2rUMdPDB7YUpyBo9idjrJ6Cmq6F",
      "name": "fuse",
      "version": "0.2.3"
    },

So I go gx-go link QmSJBsmLP1XMjv8hxYg2rUMdPDB7YUpyBo9idjrJ6Cmq6F and I get the following error message:

$ gx-go link QmSJBsmLP1XMjv8hxYg2rUMdPDB7YUpyBo9idjrJ6Cmq6F
writing package to: /Users/rob/golang/src/gx/ipfs/QmSJBsmLP1XMjv8hxYg2rUMdPDB7YUpyBo9idjrJ6Cmq6F
ERROR: Error: error during gx install: exit status 1
$

I've done some investigation, and I've found out its because QmSJBsmLP1XMjv8hxYg2rUMdPDB7YUpyBo9idjrJ6Cmq6F has a package.json, but the underlying get repo (github.com/bazil/fuse) does NOT have a package.json.

So what the problem is that during the course of the install gx-go is going to $GOPATH/src/bazil.org/fuse and running gx install only to error out because there's no package.json in that directory.

What's the correct way to gx-go link a package without a real package.json? Should I just cp it in manually?