Skip to content

Commit

Permalink
Infer name in plural link (#419)
Browse files Browse the repository at this point in the history
The basename of the path is actually always the same as the module name, so we can actually infer this.
  • Loading branch information
michaeljguarino authored Jun 19, 2023
1 parent 885ff98 commit f2bfa20
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/plural/link.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package plural

import (
"path/filepath"

"github.com/pluralsh/plural/pkg/manifest"
"github.com/urfave/cli"
)
Expand Down Expand Up @@ -36,6 +38,10 @@ func handleLink(c *cli.Context) error {
tool, repo := c.Args().Get(0), c.Args().Get(1)
name, path := c.String("name"), c.String("path")

if name == "" {
name = filepath.Base(path)
}

manPath, err := manifest.ManifestPath(repo)
if err != nil {
return err
Expand Down

0 comments on commit f2bfa20

Please sign in to comment.