ability to omit front end files like .css .js .html and so on
This commit is contained in:
+9
-1
@@ -58,6 +58,7 @@ Examples:
|
||||
protonDrive bool
|
||||
drivePath string
|
||||
verticalSlices bool
|
||||
skipFrontend bool
|
||||
)
|
||||
|
||||
func Execute() {
|
||||
@@ -78,6 +79,7 @@ func init() {
|
||||
rootCmd.Flags().BoolVar(&protonDrive, "proton-drive", false, "upload output to Proton Drive after writing locally")
|
||||
rootCmd.Flags().StringVar(&drivePath, "drive-path", "", "full remote path on Proton Drive (e.g. /my-files/md/report.md). Requires --proton-drive")
|
||||
rootCmd.Flags().BoolVar(&verticalSlices, "vertical-slices", false, "split output into root file + one markdown per top-level directory")
|
||||
rootCmd.Flags().BoolVar(&skipFrontend, "skip-frontend", false, "omit frontend file types (.html, .css, .js, .ts, .vue, .svelte, etc.)")
|
||||
|
||||
rootCmd.MarkPersistentFlagRequired("output")
|
||||
}
|
||||
@@ -95,6 +97,11 @@ func run(cmd *cobra.Command, args []string) error {
|
||||
return fmt.Errorf("--vertical-slices cannot be used with --input-file")
|
||||
}
|
||||
|
||||
excludedExts := append(config.DefaultExts, extensions...)
|
||||
if skipFrontend {
|
||||
excludedExts = append(excludedExts, config.FrontendExts...)
|
||||
}
|
||||
|
||||
cfg := &config.Config{
|
||||
OutputPath: outputPath,
|
||||
AppendMode: appendMode,
|
||||
@@ -102,10 +109,11 @@ func run(cmd *cobra.Command, args []string) error {
|
||||
MaxSize: maxSize,
|
||||
MaxDepth: maxDepth,
|
||||
Ignores: append(config.DefaultIgnores, ignorePatterns...),
|
||||
Extensions: append(config.DefaultExts, extensions...),
|
||||
Extensions: excludedExts,
|
||||
ProtonDrive: protonDrive,
|
||||
DrivePath: drivePath,
|
||||
VerticalSlices: verticalSlices,
|
||||
SkipFrontend: skipFrontend,
|
||||
}
|
||||
|
||||
if singleFile != "" {
|
||||
|
||||
Reference in New Issue
Block a user