Porcelain.spawn_shell error on windows
amitk75 opened this issue · comments
Hi,
I am using Porcelain.spawn_shell to execute certain commands on windows. Below is the code sample from a Phoenix application using websockets:
Porcelain.spawn_shell("ping -n 5 -i 10 1.1.1.1", in: "", out: {:send, self()})
I am getting error on windows. Same code works fine on linux though...
** (ArgumentError) argument error
:erlang.++("C:\Windows\system32\cmd.exe", '.exe')
(kernel) os.erl:146: :os.verify_executable/3
(kernel) os.erl:126: :os.find_executable/2
(porcelain) lib/porcelain/drivers/basic_driver.ex:103: Porcelain.Driver.Basic.find_executable/2
(porcelain) lib/porcelain/drivers/basic_driver.ex:53: Porcelain.Driver.Basic.do_exec/4
(porcelain) lib/porcelain.ex:273: Porcelain.catch_throws/1
Porcelain.spawn is working with some code changes. I am not sure if there is some issue with my code or Porcelain (or something else). Also, what is the difference between spawn and spawn_shell?
Versions:
- Windows Server 2007, 32bit
- OTP: 18.3
- Porcelain: 2.0
Hi. Could you try using the master branch and see if it fixes the issue?