Files
wren/apps/merge_all_wren.wren
T
retoor d487109d7c feat: add fswatch, sysinfo, udp modules and file copy/move/stat time operations
Add three new native modules (fswatch, sysinfo, udp) to the Wren CLI build system and module registry. Extend the io module with async file copy and move operations using libuv uv_fs_copyfile and uv_fs_rename, plus expose stat mtime/atime/ctime fields and stdin windowSize. Update the io.wren wrapper with File.write, File.copy, File.move static methods and corresponding foreign declarations. Add shebang lines to generator2.wren, merge_all_wren.wren, merge_docs.wren, and phonebook.wren scripts.
2026-01-25 10:42:49 +00:00

34 lines
678 B
JavaScript
Executable File
Vendored

#!/usr/local/bin/wren
import "io" for File, Directory
class WrenFileReader {
static listWrenFiles(dir) {
var files = []
var entries = Directory.list(dir)
for (entry in entries) {
var fullPath = "%(dir)/%(entry)"
if (Directory.exists(fullPath)) {
files.addAll(listWrenFiles(fullPath))
} else if (entry.endsWith(".wren")) {
files.add(fullPath)
}
}
return files
}
static readFiles(files) {
for (file in files) {
System.print("--- %(file) ---")
System.print(File.read(file))
}
}
static main() {
var wrenFiles = listWrenFiles(".")
readFiles(wrenFiles)
}
}
WrenFileReader.main()