From eea119487cfbaa5ca693aa1d8ac162d0238bf31e Mon Sep 17 00:00:00 2001 From: BanceDev Date: Wed, 4 Sep 2024 09:04:00 -0400 Subject: added exists function to lua api --- .lush/scripts/example.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to '.lush') diff --git a/.lush/scripts/example.lua b/.lush/scripts/example.lua index 8da0435..04cb516 100644 --- a/.lush/scripts/example.lua +++ b/.lush/scripts/example.lua @@ -44,3 +44,8 @@ print(cwd) lush.cd("~/.lush/scripts") lush.exec('cat "example.lua" | grep "hello" | sort | uniq') lush.cd(cwd) + +-- exists allows you to check if a file or directory exists +if lush.exists("~/.lush/scripts/example.lua") then + print("example.lua exists") +end -- cgit v1.2.3-59-g8ed1b