Skip to content

Commit 12a4578

Browse files
committed
Return the proper exit code from powershell
1 parent 0ff6850 commit 12a4578

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/mix/lib/mix/utils.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,8 @@ defmodule Mix.Utils do
441441
System.find_executable("curl") ->
442442
Mix.shell.cmd(~s(curl -s -S -L -o "#{out_path}" "#{path}"))
443443
windows? && System.find_executable("powershell") ->
444-
command = ~s[$client = new-object System.Net.WebClient; ] <>
444+
command = ~s[$ErrorActionPreference = 'Stop'; ] <>
445+
~s[$client = new-object System.Net.WebClient; ] <>
445446
~s[$client.DownloadFile(\\"#{path}\\", \\"#{out_path}\\")]
446447
Mix.shell.cmd(~s[powershell -Command "& {#{command}}"])
447448
true ->

0 commit comments

Comments
 (0)