fix bugs
This commit is contained in:
@@ -173,8 +173,6 @@ func run(cmd *cobra.Command, args []string) error {
|
|||||||
return fmt.Errorf("failed to resolve output path: %w", err)
|
return fmt.Errorf("failed to resolve output path: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
absOutput = filepath.Join(filepath.Dir(absOutput), filepath.Base(absOutput)+"_dirmd")
|
|
||||||
|
|
||||||
if !appendMode {
|
if !appendMode {
|
||||||
if _, err := os.Stat(absOutput); err == nil && !force {
|
if _, err := os.Stat(absOutput); err == nil && !force {
|
||||||
return fmt.Errorf("output directory %s already exists (use -f to overwrite)", absOutput)
|
return fmt.Errorf("output directory %s already exists (use -f to overwrite)", absOutput)
|
||||||
|
|||||||
@@ -89,17 +89,9 @@ func Generate(cfg *config.Config) GenerateResult {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
if cfg.VerticalSlices {
|
if err := drive.UploadDir(cfg.OutputPath, remoteDir); err != nil {
|
||||||
if err := drive.UploadDir(cfg.OutputPath, remoteDir); err != nil {
|
result.Error = fmt.Errorf("drive upload: %w", err)
|
||||||
result.Error = fmt.Errorf("drive upload: %w", err)
|
return result
|
||||||
return result
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
indexPath := filepath.Join(cfg.OutputPath, "index_"+repoName+".md")
|
|
||||||
if err := drive.Upload(indexPath, remoteDir); err != nil {
|
|
||||||
result.Error = fmt.Errorf("drive upload: %w", err)
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
result.Uploaded = true
|
result.Uploaded = true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user