add postfix repos name to all files
This commit is contained in:
+5
-2
@@ -154,6 +154,7 @@ func run(cmd *cobra.Command, args []string) error {
|
||||
return fmt.Errorf("cannot create output directory: %w", err)
|
||||
}
|
||||
|
||||
repoName := filepath.Base(cfg.AbsRoot)
|
||||
fmt.Printf("%s\n", absOutput)
|
||||
|
||||
result, err := walker.Run(cfg)
|
||||
@@ -165,8 +166,10 @@ func run(cmd *cobra.Command, args []string) error {
|
||||
return fmt.Errorf("no readable text files found in %s", cfg.AbsRoot)
|
||||
}
|
||||
|
||||
indexBasename := "index_" + repoName + ".md"
|
||||
|
||||
if verticalSlices {
|
||||
generated, err := renderer.WriteSlices(result, absOutput)
|
||||
generated, err := renderer.WriteSlices(result, absOutput, repoName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -197,7 +200,7 @@ func run(cmd *cobra.Command, args []string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
indexPath := filepath.Join(absOutput, "index.md")
|
||||
indexPath := filepath.Join(absOutput, indexBasename)
|
||||
|
||||
if err := renderer.Write(result, indexPath, appendMode, cfg.SingleFile); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user