mirror of
https://github.com/tnypxl/rollup.git
synced 2025-12-15 23:13:22 +00:00
flatten scrape config to 'sites:'
* flatten scrape config to 'sites:'. Update unit tests and readme. * remove check for file_extensions configuration. * show progress indication after 5 seconds. * add documentation to functions * fix: remove MaxDepth and link extraction functionality * fix: Remove MaxDepth references from cmd/web.go
This commit is contained in:
@@ -38,23 +38,23 @@ func runGenerate(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
|
||||
cfg := config.Config{
|
||||
FileTypes: make([]string, 0, len(fileTypes)),
|
||||
Ignore: []string{"node_modules/**", "vendor/**", ".git/**"},
|
||||
FileExtensions: make([]string, 0, len(fileTypes)),
|
||||
IgnorePaths: []string{"node_modules/**", "vendor/**", ".git/**"},
|
||||
}
|
||||
|
||||
for ext := range fileTypes {
|
||||
cfg.FileTypes = append(cfg.FileTypes, ext)
|
||||
cfg.FileExtensions = append(cfg.FileExtensions, ext)
|
||||
}
|
||||
|
||||
// Sort file types for consistency
|
||||
sort.Strings(cfg.FileTypes)
|
||||
sort.Strings(cfg.FileExtensions)
|
||||
|
||||
yamlData, err := yaml.Marshal(&cfg)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error marshaling config: %v", err)
|
||||
}
|
||||
|
||||
outputPath := config.DefaultConfigPath()
|
||||
outputPath := "rollup.yml"
|
||||
err = os.WriteFile(outputPath, yamlData, 0644)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error writing config file: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user