| Crates.io | flatten-project |
| lib.rs | flatten-project |
| version | 0.2.0 |
| created_at | 2024-12-06 17:07:21.365216+00 |
| updated_at | 2024-12-06 17:07:21.365216+00 |
| description | Flattens nested project directories into a single directory with underscore-delimited filenames while preserving the original structure. |
| homepage | |
| repository | https://github.com/thesurlydev/flatten |
| max_upload_size | |
| id | 1474464 |
| size | 19,919 |
A Rust CLI tool that flattens nested project directories into a single directory with underscore-delimited filenames while preserving the original structure.
.gitignore and .flatignore patternsClone the project and run:
cargo install --path .
Run in the current directory:
flatten-project
Or specify a target directory:
flatten-project /path/to/project
Given this project structure:
my-project/
├── src/
│ ├── main.rs
│ └── utils/
│ ├── helpers.rs
│ └── config/
│ └── settings.rs
├── tests/
│ └── integration.rs
└── Cargo.toml
Running flatten will create:
my-project/
├── [original structure remains]
└── flattened/
├── src_main.rs
├── src_utils_helpers.rs
├── src_utils_config_settings.rs
├── tests_integration.rs
└── Cargo.toml
The tool respects both .gitignore and .flatignore files. Create a .flatignore file to specify additional patterns for files you don't want to include in the flattened output:
# .flatignore
Cargo.lock
*.tmp
build/