mirror of
https://github.com/jessebot/dot_files.git
synced 2025-10-01 01:48:43 +00:00
always check to verify that personal_wezterm_config.lua exists before importing anything from it
This commit is contained in:
parent
11875a3856
commit
88f130c69e
1 changed files with 11 additions and 2 deletions
|
@ -1,4 +1,3 @@
|
|||
local personal_config = require 'personal_wezterm_config'
|
||||
local wezterm = require 'wezterm'
|
||||
local act = wezterm.action
|
||||
|
||||
|
@ -166,8 +165,18 @@ local config = {
|
|||
}
|
||||
|
||||
-- add ssh_domains only if they're present in a local file
|
||||
local function file_exists(name)
|
||||
local f=io.open(name,"r")
|
||||
if f~=nil then io.close(f) return true else return false end
|
||||
end
|
||||
|
||||
|
||||
local function add_personal_config()
|
||||
config["ssh_domains"] = personal_config.ssh_domains
|
||||
local home = os.getenv("HOME")
|
||||
if file_exists(home .. '/.config/wezterm/personal_wezterm_config.lua') then
|
||||
local personal_config = require 'personal_wezterm_config'
|
||||
config["ssh_domains"] = personal_config.ssh_domains
|
||||
end
|
||||
end
|
||||
|
||||
pcall(add_personal_config)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue