A comprehensive guide to FileFusion's file pattern matching system
- Pattern:
*.go
- Matches:
main.go
handlers/utils.go
core/main.go
- Pattern:
*.json,*.yaml
- Matches:
config.json
settings.yaml
nested/data.json
- Pattern:
*.txt
- Matches:
logs/errors.txt
nested/directory/notes.txt
- Exclusion:
build/**
- Matches files in:
src/main.go
- Does not match:
build/output.json
build/logs/errors.log
- Exclusion:
*.log
- Matches:
main.go
config.json
- Does not match:
app.log
nested/errors.log
- Exclusion:
logs/*.txt
- Matches:
logs/errors.log
main.go
- Does not match:
logs/errors.txt
Exclude hidden directories:
- Exclusion:
**/.hidden/**
- Matches:
src/file.go
- Does not match:
.hidden/file.txt
nested/.hidden/file.txt
- Exclusion:
build/**,node_modules/**
- Matches:
src/main.go
- Does not match:
build/main.o
node_modules/lib/index.js
- Exclusion:
README.md
- Matches:
main.go
- Does not match:
README.md
- Exclusion:
**/#*
- Matches:
main.go
- Does not match:
#tempfile.txt
- Input Pattern:
*.go,*.json
- Matches:
main.go
config.json
- Matches:
- Exclusion:
build/**,test/**
- Does not match:
build/main.go
test/utils_test.go
- Does not match:
- Resulting Files:
src/main.go
src/config.json
- Input Pattern:
**/*.txt
- Exclusion:
logs/**
- Matches:
docs/readme.txt
- Does not match:
logs/errors.txt
- Matches:
# Include all Go-related files
filefusion -p "*.go,*.mod,*.sum" .
# Include Go files but exclude tests
filefusion -p "*.go" -e "*_test.go" .
# Process frontend source files
filefusion -p "*.{js,ts,jsx,tsx,css,scss}" /src
# Include configuration but exclude build artifacts
filefusion -p "*.{js,json,yaml,env}" -e "dist/**,build/**"
# Process only React components
filefusion -p "*.{jsx,tsx}" src/components/
# Multiple file types and exclusions
filefusion \
-p "*.go,*.yaml,*.json" \
-e "**/*_test.go,vendor/**,**/testdata/**" \
internal cmd
# will generate 2 output files internal.xml and cmd.xml
# Specific directory patterns with multiple exclusions
filefusion \
-p "*.{js,ts}, *.{json,yaml},*.sh" \
-e "**/*.test.{js,ts},**/__tests__/**,**/node_modules/**"
# Documentation and configuration files
filefusion \
-p "*.md,*.{yaml,yml,json}" \
-e "**/draft/**,**/.git/**,private/**" \
.
# Python project
filefusion \
-p "*.{py,ipynb},requirements.txt,setup.py" \
-e "**/__pycache__/**,**/*.pyc,venv/**" \
.
# Java/Kotlin project
filefusion \
-p "*.{java,kt},build.gradle,pom.xml" \
-e "**/build/**,**/target/**,**/*Test.{java,kt}" \
. src
# Full-stack project
filefusion \
-p "*.go,*.{ts,tsx},*.yaml" \
-e "**/node_modules/**,**/dist/**,**/*_test.go" \
. backend frontend/src
- Pattern:
***
- Error: "invalid pattern: contains invalid glob pattern '***'"
- Valid For Exclusion:
**/file.*
,**/*.txt
- Invalid:
***/*.txt
(returns an error)
Made with ❤️ by the DrGos