Skip to content

Commit

Permalink
Third try
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Dec 11, 2023
1 parent 20e9a94 commit 4e272ea
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
20 changes: 12 additions & 8 deletions bin/elixir.bat
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ if "!par!"=="" (
goto run
)
shift
set par="!par:"=\"!"
set par=!par:^!=^^^!!
set "par=!par:"=\"!"
set "par=!par:^|=\^|!"
set "par=!par:!=^^!!"
if !endLoop! == 1 (
set parsElixir=!parsElixir! !par!
goto startloop
Expand All @@ -110,26 +111,29 @@ rem ******* EVAL PARAMETERS ************************
if ""==!par:-e=! (
set "VAR=%~1"
if not defined VAR (set VAR= )
set VAR="!VAR:"=\"!"
set VAR=!VAR:^!=^^^!!
set "VAR=!VAR:"=\"!"
set "VAR=!VAR:^|=\^|!"
set "VAR=!VAR:!=^^!!"
set parsElixir=!parsElixir! -e "!VAR"
shift
goto startloop
)
if ""==!par:--eval=! (
set "VAR=%~1"
if not defined VAR (set VAR= )
set VAR="!VAR:"=\"!"
set VAR=!VAR:^!=^^^!!
set "VAR=!VAR:"=\"!"
set "VAR=!VAR:^|=\^|!"
set "VAR=!VAR:!=^^!!"
set parsElixir=!parsElixir! --eval "!VAR"
shift
goto startloop
)
if ""==!par:--rpc-eval=! (
set "VAR=%~2"
if not defined VAR (set VAR= )
set VAR="!VAR:"=\"!"
set VAR=!VAR:^!=^^^!!
set "VAR=!VAR:"=\"!"
set "VAR=!VAR:^|=\^|!"
set "VAR=!VAR:!=^^!!"
set parsElixir=!parsElixir! --rpc-eval %1 "!VAR"
shift
shift
Expand Down
2 changes: 1 addition & 1 deletion lib/elixir/test/elixir/kernel/cli_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ defmodule Kernel.CLITest do
assert output =~ "hello_world123"

# Check for exclamation mark handling on Windows
assert {_output, 0} = System.cmd(elixir_executable(), ["-e", "URI.new!(~s())"])
assert {_output, 0} = System.cmd(elixir_executable(), ["-e", "URI.new!(~s||)"])

{output, 0} = System.cmd(iex_executable(), ["-e", "IO.puts :hello_world123; System.halt()"])
assert output =~ "hello_world123"
Expand Down

0 comments on commit 4e272ea

Please sign in to comment.