Compare commits

2 Commits

Author SHA1 Message Date
murat 5b31f680be Initialize main file 2026-06-02 20:20:09 +03:00
murat 9c453d1f2e added testing directory to gitignore 2026-06-02 16:31:11 +03:00
2 changed files with 37 additions and 0 deletions
+3
View File
@@ -39,3 +39,6 @@ luac.out
*.x86_64
*.hex
# Testing Fİles
testing/
testing/*
+34
View File
@@ -0,0 +1,34 @@
local lfs = require("lfs")
-- list of markdown files in working directory
local markdownFiles = {}
-- amount of markdown files in working directory
local markdownFileCount = 0
local currentDir = lfs.currentdir()
for file in lfs.dir(currentDir) do
-- ignore "." and ".." files
if not(file:sub(1,3) == ".." or file:sub(1,2) == '.') then
local filePath = currentDir .. '/' .. file
-- match file names ending with ".md"
if file:match("%.md$") then
markdownFileCount = markdownFileCount + 1
markdownFiles[markdownFileCount] = filePath
end
end
end
for index, value in ipairs(markdownFiles) do
-- print file path with index
print(index .. ': ' .. markdownFiles[index])
local f = io.open(markdownFiles[index], 'r')
if f then
local content = f:read("*all")
f:close()
-- print file content
print(content)
else
print("can't read the file ".. markdownFiles[index])
end
end