Skip to content

Commit 68400fd

Browse files
committed
On windows also use os.execute for pm cli flag now that we have pragtical.com
1 parent a7db005 commit 68400fd

1 file changed

Lines changed: 9 additions & 16 deletions

File tree

plugins/plugin_manager/init.lua

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -601,22 +601,15 @@ cli.register {
601601
)
602602
os.exit(exit_code or 0)
603603
else
604-
-- compatibility with pragtical.com binary under Windows
605-
local cmd = '"' .. config.plugins.plugin_manager.ppm_binary_path .. '" '
606-
.. '--assume-yes '
607-
.. '--userdir="'..USERDIR..'" '
608-
.. '--binary="'..EXEFILE..'" '
609-
.. table.concat(ARGS, " ", start)
610-
local pm = process.start(cmd)
611-
if pm then
612-
repeat
613-
local out = pm:read_stdout()
614-
local err = pm:read_stderr()
615-
if out then io.stdout:write(out) end
616-
if err then io.stderr:write(err) end
617-
until not pm:running()
618-
os.exit(pm:returncode() or 1)
619-
end
604+
-- handle arguments on windows
605+
local exit_code = os.execute(
606+
string.format(
607+
'cmd /c ""%s" --userdir="%s" --binary="%s" %s"',
608+
config.plugins.plugin_manager.ppm_binary_path,
609+
USERDIR, EXEFILE, table.concat(ARGS, " ", start)
610+
)
611+
)
612+
os.exit(exit_code or 0)
620613
end
621614
end
622615
end

0 commit comments

Comments
 (0)