aboutsummaryrefslogtreecommitdiffstats
path: root/.lush
diff options
context:
space:
mode:
authorGravatar BanceDev 2024-09-08 22:13:17 -0400
committerGravatar BanceDev 2024-09-08 22:13:17 -0400
commit6a2689d4ea04c79f7ef1fddf369dafbfd14e64e6 (patch)
treeb1c628a72a60cb91e04e8b095c911255e359f9bd /.lush
parentadded lua api functions for indexing history (diff)
added getenv and putenv to Lua API
fixed bug where terminal closed upon encountering Lua error
Diffstat (limited to '.lush')
-rw-r--r--.lush/scripts/example.lua6
1 files changed, 6 insertions, 0 deletions
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"))