Skip to content

Commit

Permalink
Fixed absolute directory for manpages
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasdille committed Mar 5, 2024
1 parent 79b477b commit 2e8358b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/uniget/man.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/pterm/pterm"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/uniget-org/cli/pkg/logging"
)

var manDirectory string
Expand All @@ -26,8 +27,9 @@ var manCmd = &cobra.Command{
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
if (manDirectory[0:1] != "/") && (manDirectory[0:1] != ".") {
manDirectory = fmt.Sprintf("%s/%s", viper.GetString("target"), manDirectory)
manDirectory = fmt.Sprintf("%s/%s", "/"+viper.GetString("target"), manDirectory)
}
logging.Debugf("Using base directory for manpages: %s", manDirectory)

err := writeManpage(rootCmd, "", manDirectory)
if err != nil {
Expand Down

0 comments on commit 2e8358b

Please sign in to comment.