aboutsummaryrefslogtreecommitdiffstats
path: root/.lush/scripts/example.lua
diff options
context:
space:
mode:
Diffstat (limited to '.lush/scripts/example.lua')
-rw-r--r--.lush/scripts/example.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/.lush/scripts/example.lua b/.lush/scripts/example.lua
index 0239500..b3de3cb 100644
--- a/.lush/scripts/example.lua
+++ b/.lush/scripts/example.lua
@@ -96,3 +96,13 @@ lush.unsetenv("EXAMPLE")
-- this function is very useful if you want to make certain kinds of custom prompts in your init.lua
print("Terminal Columns: " .. lush.termCols())
print("Terminal Rows: " .. lush.termRows())
+
+-- the glob function scans the current working directory for files with the given extension and returns
+-- them as an array of strings
+local textFiles = lush.glob("txt")
+if textFiles ~= nil then
+ print("Printing txt files:")
+ for i = 1, #textFiles do
+ print(textFiles[i])
+ end
+end