| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- @echo off
- setlocal enabledelayedexpansion
- rem Generate directory structure file for Visual Studio extension project
- rem Excludes: .vs, bin, obj directories and *.user files
- set OUTPUT_FILE=directory_structure.txt
- set CURRENT_DIR=%CD%
- echo Generating directory structure...
- echo Project Directory Structure > "%OUTPUT_FILE%"
- echo Generated on: %DATE% %TIME% >> "%OUTPUT_FILE%"
- echo Root: %CURRENT_DIR% >> "%OUTPUT_FILE%"
- echo. >> "%OUTPUT_FILE%"
- rem Function to process directory recursively
- call :ProcessDirectory "." ""
- echo.
- echo Directory structure generated successfully in: %OUTPUT_FILE%
- pause
- goto :eof
- :ProcessDirectory
- set "dir_path=%~1"
- set "indent=%~2"
- rem Get directory name for display
- for %%F in ("%dir_path%") do set "dir_name=%%~nxF"
- rem Skip excluded directories
- if /i "%dir_name%"==".vs" goto :eof
- if /i "%dir_name%"=="bin" goto :eof
- if /i "%dir_name%"=="obj" goto :eof
- if /i "%dir_name%"=="packages" goto :eof
- if /i "%dir_name%"==".git" goto :eof
- if /i "%dir_name%"=="node_modules" goto :eof
- rem Print current directory (except root)
- if not "%dir_path%"=="." (
- echo %indent%%dir_name%/ >> "%OUTPUT_FILE%"
- set "new_indent=%indent% "
- ) else (
- set "new_indent="
- )
- rem Process files in current directory
- for %%F in ("%dir_path%\*") do (
- set "file_name=%%~nxF"
- set "file_ext=%%~xF"
-
- rem Skip user-specific and temporary files
- if /i not "!file_ext!"==".user" (
- if /i not "!file_ext!"==".suo" (
- if /i not "!file_ext!"==".cache" (
- if /i not "!file_name!"==".gitignore" (
- if /i not "!file_name!"=="Thumbs.db" (
- if /i not "!file_name!"=="Desktop.ini" (
- echo %new_indent%!file_name! >> "%OUTPUT_FILE%"
- )
- )
- )
- )
- )
- )
- )
- rem Process subdirectories
- for /d %%D in ("%dir_path%\*") do (
- call :ProcessDirectory "%%D" "%new_indent%"
- )
- goto :eof
|