Skip to content

Commit

Permalink
feat: try two path
Browse files Browse the repository at this point in the history
  • Loading branch information
TwIStOy committed Nov 29, 2023
1 parent 42ee263 commit 039041e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lua/ht/core/globals.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
local M = {}

local default_vault_path = "~/Documents/Main"
local default_vault_path = {
"~/Documents/Main",
"~/Projects/obsidian-data/Main",
}

local function resolve_obsidian_vault()
if vim.g.obsidian_vault_path then
return vim.fn.resolve(vim.fn.expand(vim.g.obsidian_vault_path))
end
return vim.fn.resolve(vim.fn.expand(default_vault_path))
for _, path in ipairs(default_vault_path) do
local p = vim.fn.resolve(vim.fn.expand(path))
if vim.fn.isdirectory(p) == 1 then
return p
end
end
return vim.fn.resolve(vim.fn.expand(default_vault_path[1]))
end

local function resolve_has_obsidian_vault()
Expand Down

0 comments on commit 039041e

Please sign in to comment.