summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2015-11-05 15:32:34 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2015-11-05 15:32:34 +0000
commit4baf90acc593a8145440c3277957657d6725af2a (patch)
tree91bfd479ea9de5326bd81fba5bd7d9991f26277c
parentcc40ff8b4a3b21059eb04831afa4f36938314a8f (diff)
downloadgitano-4baf90acc593a8145440c3277957657d6725af2a.tar.bz2
Support renaming the user calling user rename
-rw-r--r--lib/gitano/admincommand.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gitano/admincommand.lua b/lib/gitano/admincommand.lua
index a262df6..334c4d3 100644
--- a/lib/gitano/admincommand.lua
+++ b/lib/gitano/admincommand.lua
@@ -287,6 +287,10 @@ local function builtin_user_run(conf, _, cmdline, env)
conf.users[oldusername] = nil
-- And explain what
reason = "Rename user " .. oldusername .. " to " .. newusername
+ -- Finally update the environment if necessary
+ if env.GITANO_USER == oldusername then
+ env.GITANO_USER = newusername
+ end
end
end
if reason then