aboutsummaryrefslogtreecommitdiff
path: root/core/args.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2015-03-12 16:52:40 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2015-03-12 16:52:40 -0400
commit4ca29592357e698959441392a9e7b9b38dcf38c0 (patch)
tree0bdca0c14a3057b54242f360c70abc28fc1ff16b /core/args.lua
parent75a66036a42d117decbd29eb78bd55283b6972e1 (diff)
downloadtextadept-4ca29592357e698959441392a9e7b9b38dcf38c0.tar.gz
textadept-4ca29592357e698959441392a9e7b9b38dcf38c0.zip
Lua code cleanup.
Diffstat (limited to 'core/args.lua')
-rw-r--r--core/args.lua9
1 files changed, 4 insertions, 5 deletions
diff --git a/core/args.lua b/core/args.lua
index 8b478aa9..907fd465 100644
--- a/core/args.lua
+++ b/core/args.lua
@@ -83,17 +83,16 @@ if WIN32 and not CURSES and #arg[0] > 0 then
end
-- Set `_G._USERHOME`.
-local userhome = os.getenv(not WIN32 and 'HOME' or 'USERPROFILE')..'/.textadept'
+_USERHOME = os.getenv(not WIN32 and 'HOME' or 'USERPROFILE')..'/.textadept'
for i = 1, #arg do
if (arg[i] == '-u' or arg[i] == '--userhome') and arg[i + 1] then
- userhome = arg[i + 1]
+ _USERHOME = arg[i + 1]
break
end
end
-if not lfs.attributes(userhome) then lfs.mkdir(userhome) end
-local f = io.open(userhome..'/init.lua', 'a+') -- ensure existence
+if not lfs.attributes(_USERHOME) then lfs.mkdir(_USERHOME) end
+local f = io.open(_USERHOME..'/init.lua', 'a+') -- ensure existence
if f then f:close() end
-_G._USERHOME = userhome
M.register('-u', '--userhome', 1, function() end, 'Sets alternate _USERHOME')
M.register('-f', '--force', 0, function() end, 'Forces unique instance')