@@ -25,15 +25,17 @@ local C = require('devdocs.constants')
25
25
26
26
--- Creates a directory using a shell command native to the platform
27
27
--- @param dir string Directory to create
28
- M .Mkdir = function (dir )
28
+ M .Mkdir = function (dir )
29
29
os.execute (' mkdir -p ' .. dir )
30
30
end
31
31
32
32
-- Update for windows
33
33
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 )
35
35
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
+ .. " '"
37
39
)
38
40
end
39
41
end
@@ -162,7 +164,10 @@ M.ExtractDocs = function(slug, callback)
162
164
local htmlContent = entry .value
163
165
local parts = vim .split (title , ' /' , { trimempty = true , plain = true })
164
166
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 ' ' )
166
171
local outputFile = dir .. ' /' .. filename
167
172
168
173
M .Mkdir (dir )
@@ -185,7 +190,7 @@ M.ExtractDocs = function(slug, callback)
185
190
downloaded = true ,
186
191
extracted = true ,
187
192
})
188
- vim .schedule (function ()
193
+ vim .schedule (function ()
189
194
vim .notify (' Downloaded Docs for ' .. slug .. ' successfully' )
190
195
end )
191
196
if callback ~= nil then
0 commit comments