Skip to content

Commit f2bfa20

Browse files
Infer name in plural link (#419)
The basename of the path is actually always the same as the module name, so we can actually infer this.
1 parent 885ff98 commit f2bfa20

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

cmd/plural/link.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package plural
22

33
import (
4+
"path/filepath"
5+
46
"github.com/pluralsh/plural/pkg/manifest"
57
"github.com/urfave/cli"
68
)
@@ -36,6 +38,10 @@ func handleLink(c *cli.Context) error {
3638
tool, repo := c.Args().Get(0), c.Args().Get(1)
3739
name, path := c.String("name"), c.String("path")
3840

41+
if name == "" {
42+
name = filepath.Base(path)
43+
}
44+
3945
manPath, err := manifest.ManifestPath(repo)
4046
if err != nil {
4147
return err

0 commit comments

Comments
 (0)