Files
herolib/lib/develop/codewalker
Mahmoud-Emad 1228441fd6 feat: Add Buildah builder API and refactor module
- Introduce `Builder` struct for image creation
- Implement `PodmanFactory` methods for builder lifecycle
- Rename `herocontainers` module to `podman`
- Update `PodmanFactory.new` with platform checks
- Revise documentation for `podman` and Buildah usage
2025-08-26 20:28:38 +03:00
..
...
2025-08-25 05:44:45 +02:00
...
2025-08-21 12:05:20 +02:00
2025-08-17 20:19:41 +03:00

CodeWalker Module

The CodeWalker module provides functionality to walk through directories and create a map of files with their content. It's particularly useful for processing code directories while respecting gitignore patterns.

Features

  • Walk through directories recursively
  • Respect gitignore patterns to exclude files
  • Store file content in memory
  • Export files back to a directory structure

Usage

import freeflowuniverse.herolib.lib.lang.codewalker

mut cw := codewalker.new('/tmp/adir')!

// Get content of a specific file
content := cw.filemap.get('path/to/file.txt')!

// return output again
cw.filemap.content()

// Export all files to a destination directory
cw.filemap.export('/tmp/exported_files')!

format of filemap

full files


text before will be ignored

===FILE:filename===
code
===FILE:filename===
code
===END===

text behind will be ignored

files with changes


text before will be ignored

===FILECHANGE:filename===
code
===FILECHANGE:filename===
code
===END===

text behind will be ignored

FILECHANGE and FILE can be mixed, in FILE it means we have full content otherwise only changed content e.g. a method or s struct and then we need to use morph to change it