fixup: get network drive only, not entire path

This commit is contained in:
Jan Edmund Lazo 2018-01-11 19:16:39 -05:00
parent 273c7cfa2a
commit eb59dd6547

View File

@ -9,11 +9,10 @@ describe('fnamemodify()', function()
before_each(clear)
it('works', function()
local drive_f = io.popen('cd', 'r')
local drive = string.gsub(drive_f:read('*a'), '[\n\r]', '')
drive_f:close()
if iswin() then
local drive_f = io.popen('for %P in (%CD%) do @echo %~dP', 'r')
local drive = string.gsub(drive_f:read('*a'), '[\n\r]', '')
drive_f:close()
local root = drive..[[\]]
eq(root, fnamemodify([[\]], ':p:h'))
eq(root, fnamemodify([[\]], ':p'))