From 39ea9c1a18cb90eda64bd7ae3bf5dfda9f2e5c6f Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Wed, 18 Mar 2020 11:55:12 +1100 Subject: [PATCH] made import work, added unimport, aliased rm to fs.remove --- lib/shutil.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/shutil.lua b/lib/shutil.lua index 0de93ef..b2c436f 100644 --- a/lib/shutil.lua +++ b/lib/shutil.lua @@ -22,6 +22,19 @@ function shutil.import(lib) end require(lib) nE[#nE+1] = lib + os.setenv("INCLUDE",nE) + return true +end + +function shutil.unimport(lib) + local cE = os.getenv("INCLUDE") or shell.include + local nE = {} + for k,v in pairs(cE) do + if v ~= lib then + nE[#nE+1] = v + end + end + os.setenv("INCLUDE",nE) return true end @@ -103,5 +116,6 @@ end shutil.cd = os.chdir shutil.mkdir = fs.makeDirectory shutil.cp = fs.copy +shutil.rm = fs.remove return shutil