From 6a2689d4ea04c79f7ef1fddf369dafbfd14e64e6 Mon Sep 17 00:00:00 2001 From: BanceDev Date: Sun, 8 Sep 2024 22:13:17 -0400 Subject: added getenv and putenv to Lua API fixed bug where terminal closed upon encountering Lua error --- .lush/scripts/example.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to '.lush') diff --git a/.lush/scripts/example.lua b/.lush/scripts/example.lua index 53ee6e8..4d0b8fa 100644 --- a/.lush/scripts/example.lua +++ b/.lush/scripts/example.lua @@ -82,3 +82,9 @@ print("Most recent history: " .. lush.lastHistory()) -- you can also fetch history at a certain index in the past (1 being most recent) print("Most recent history indexed: " .. lush.getHistory(1)) + +-- you can set environment variables using putenv +lush.putenv("EXAMPLE=Lunar Shell Example") + +-- you can get an environment variable using getenv +print("Value of EXAMPLE: " .. lush.getenv("EXAMPLE")) -- cgit v1.2.3-59-g8ed1b