From cc78c4123aea2832d291ab32181c886ab49c1166 Mon Sep 17 00:00:00 2001 From: Tyler Miller Date: Tue, 1 Aug 2023 05:06:09 -0700 Subject: [PATCH] fix(compiler): use absolute gitpath in cache hash Related #262 --- lua/github-theme/init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/github-theme/init.lua b/lua/github-theme/init.lua index 274abe54..a2940b83 100644 --- a/lua/github-theme/init.lua +++ b/lua/github-theme/init.lua @@ -94,8 +94,9 @@ M.setup = function(opts) local cached_path = util.join_paths(config.options.compile_path, 'cache') local cached = read_file(cached_path) - local git_path = util.join_paths(debug.getinfo(1).source:sub(2, -27), '.git') - local git = vim.fn.getftime(git_path) + local git_path = + vim.fn.fnamemodify(vim.fn.resolve(debug.getinfo(1).source:sub(2)), ':p:h:h:h') + local git = vim.fn.getftime(util.join_paths(git_path, '.git')) local hash = require('github-theme.lib.hash')(opts) .. (git == -1 and git_path or git) if cached ~= hash then