Skip to content

Commit

Permalink
generalize get package name
Browse files Browse the repository at this point in the history
  • Loading branch information
derekbunch committed Feb 4, 2025
1 parent bf1c70b commit 908dfd8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lua/dbtpal/projects.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@ M.detect_dbt_project_dir = function(bpath)
end

M._get_package_name = function()
local name = vim.fn.system [[grep -E 'name: \S+' ~/projects/clients/causal/internal_dbt/dbt_project.yml]]
local dbt_project_dir = function()
if config.options.path_to_dbt_project ~= "" then
return config.options.path_to_dbt_project
else
return _find_project_dir()
end
end
local name = vim.fn.system [[grep -E 'name: \S+' ]] + dbt_project_dir()
return string.match(name, [[name:%s+['"]([%w_]+)]])
end

Expand Down

0 comments on commit 908dfd8

Please sign in to comment.