feat: allow setting username+pwd in config

This commit is contained in:
əlemi 2024-08-15 03:52:01 +02:00
parent 1de55250ab
commit b505033bc4
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -19,8 +19,8 @@ end
local base_actions = { local base_actions = {
connect = function(host) connect = function(host)
if host == nil then host = 'http://codemp.alemi.dev:50053' end if host == nil then host = 'http://codemp.alemi.dev:50053' end
local user = vim.fn.input("username > ", "user-" .. vim.fn.rand() % 1024) local user = vim.g.codemp_username or vim.fn.input("username > ", "user-" .. vim.fn.rand() % 1024)
local password = vim.fn.input("password > ", "lmaodefaultpassword") local password = vim.g.codemp_password or vim.fn.input("password > ", "lmaodefaultpassword")
state.client = native.connect(host, user, password) state.client = native.connect(host, user, password)
print(" ++ connected to " .. host .. " as " .. user) print(" ++ connected to " .. host .. " as " .. user)
end, end,