1
0

Check if custom ssh config exists

This commit is contained in:
Patrick Auernig 2023-05-13 13:35:01 +02:00
parent a0475b1a85
commit a76f0153cd

View File

@ -1,12 +1,20 @@
local ssh_config = vim.fs.normalize((os.getenv("XDG_CONFIG_HOME") or "~/.config") .. "/ssh/config") local ssh_config = vim.fs.normalize((os.getenv("XDG_CONFIG_HOME") or "~/.config") .. "/ssh/config")
require("remote-sshfs").setup({ local config
connections = {
ssh_configs = { if vim.fn.filereadable(ssh_config) == 1 then
ssh_config, config = {
}, connections = {
sshfs_args = { ssh_configs = {
"-F " .. ssh_config, ssh_config,
},
sshfs_args = {
"-F " .. ssh_config,
}
} }
} }
}) else
config = {}
end
require("remote-sshfs").setup(config)