Skip to content

Notten02/filesystemdraw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Filesystem Draw

A Go application that creates a visual tree map of a file structure based on PowerShell's Get-ChildItem -Recurse -Force output or GitHub Actions logs.

Usage

Tree Output Mode (with -out flag)

Generate a visual tree structure and exit:

# From PowerShell
Get-ChildItem -Recurse -Force | go run main.go -out=true

# From a saved file
Get-Content example.txt | go run main.go -out=true

# From GitHub Actions logs starting at line 370
Get-Content github-actions-log.txt | go run main.go -start 370 -out=1

Interactive File Search Mode (default)

When -out is not provided, the program enters interactive mode where you can search for files:

Get-Content example.txt | go run main.go

In interactive mode you can:

  • Check if a full path exists: Enter a complete file path to get true or false

    > D:\a\project\.sonarqube\bin\Newtonsoft.Json.dll
    true
    
  • Search for a filename: Enter just a filename to find all matching paths

    > Newtonsoft.Json.dll
    Found 1 occurrence(s):
      D:\a\project\.sonarqube\bin\Newtonsoft.Json.dll
    
  • Type exit or quit to exit interactive mode

From GitHub Actions logs

The tool automatically detects and strips GitHub Actions timestamps. You can specify a starting line number to skip irrelevant content:

# Process entire log
Get-Content github-actions-log.txt | go run main.go

# Start reading from line 370
Get-Content github-actions-log.txt | go run main.go -start 370

The program will automatically stop reading when it detects the directory blocks have ended (after 10 consecutive non-matching lines).

Build

go build -o filesystemdraw.exe main.go

Then use:

# Tree output mode
Get-ChildItem -Recurse -Force | .\filesystemdraw.exe -out=true

# Interactive search mode
Get-Content log.txt | .\filesystemdraw.exe

# With GitHub Actions log starting from a specific line
Get-Content log.txt | .\filesystemdraw.exe -start 370 -out=1

Features

  • Parses standard PowerShell Get-ChildItem -Recurse -Force output
  • Automatically handles GitHub Actions log format (strips timestamps)
  • Start reading from a specific line with -start flag
  • Auto-detects end of directory listings
  • Two modes of operation:
    • Tree output mode (-out flag): Creates visual tree structure with box-drawing characters
    • Interactive search mode (default): Search for files by full path or filename
  • Case-insensitive file path matching
  • Handles both files and directories

Command Line Flags

  • -start <line_number>: Start reading from the specified line number (default: 0)
  • -out <value>: Output the tree structure and exit. Any non-empty value enables this mode

Example Output

D:\a\program
├── .sonarqube
│   ├── bin
│   │   ├── targets
│   │   │   └── SonarQube.Integration.targets
│   │   ├── Newtonsoft.Json.dll
│   │   ├── SonarScanner.MSBuild.Common.dll
│   │   └── SonarScanner.MSBuild.Tasks.dll
│   ├── conf
│   └── out
├── coverage-reports
├── merged-coverage
├── trx-reports
└── src

About

draw filesystem from logs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages