Skip to content

Commit eee96fe

Browse files
phanenmaskudo
authored andcommitted
chore: fmt with stylua
1 parent 77ef49c commit eee96fe

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Diff for: lua/devdocs/docs.lua

+10-5
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,17 @@ local C = require('devdocs.constants')
2525

2626
---Creates a directory using a shell command native to the platform
2727
---@param dir string Directory to create
28-
M.Mkdir = function (dir)
28+
M.Mkdir = function(dir)
2929
os.execute('mkdir -p ' .. dir)
3030
end
3131

3232
-- Update for windows
3333
if vim.fn.has('win32') == 1 or vim.fn.has('win64') == 1 or os.getenv('OS') == 'Windows_NT' then
34-
M.Mkdir = function (dir)
34+
M.Mkdir = function(dir)
3535
os.execute(
36-
"powershell.exe -NoLogo -NonInteractive -NoProfile -Command New-Item -ErrorAction SilentlyContinue -ItemType Directory -Force -Path '" .. dir .."'"
36+
"powershell.exe -NoLogo -NonInteractive -NoProfile -Command New-Item -ErrorAction SilentlyContinue -ItemType Directory -Force -Path '"
37+
.. dir
38+
.. "'"
3739
)
3840
end
3941
end
@@ -162,7 +164,10 @@ M.ExtractDocs = function(slug, callback)
162164
local htmlContent = entry.value
163165
local parts = vim.split(title, '/', { trimempty = true, plain = true })
164166
local filename = table.remove(parts, #parts) .. '.md'
165-
local dir = C.DOCS_DIR .. '/' .. slug .. (#parts > 0 and '/' .. table.concat(parts, '/') or '')
167+
local dir = C.DOCS_DIR
168+
.. '/'
169+
.. slug
170+
.. (#parts > 0 and '/' .. table.concat(parts, '/') or '')
166171
local outputFile = dir .. '/' .. filename
167172

168173
M.Mkdir(dir)
@@ -185,7 +190,7 @@ M.ExtractDocs = function(slug, callback)
185190
downloaded = true,
186191
extracted = true,
187192
})
188-
vim.schedule(function ()
193+
vim.schedule(function()
189194
vim.notify('Downloaded Docs for ' .. slug .. ' successfully')
190195
end)
191196
if callback ~= nil then

0 commit comments

Comments
 (0)