Skip to content

Commit

Permalink
Remove uneeded @ which may output error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
syl20bnr committed Nov 6, 2014
1 parent 655b54a commit 4242fc4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
16 changes: 8 additions & 8 deletions priv/templates/bin_windows.dtl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
:: Set the root release directory based on the location of this batch file
@set script_dir=%~dp0
@for %%A in ("%script_dir%\..") do (
@set "release_root_dir=%%~fA"
set "release_root_dir=%%~fA"
)
@set rel_dir=%release_root_dir%\releases\%rel_vsn%

Expand Down Expand Up @@ -42,9 +42,9 @@ cd %rootdir%
:find_erts_dir
@set erts_dir=%release_root_dir%\erts-%erts_vsn%
@if exist %erts_dir% (
@goto :set_erts_dir_from_default
goto :set_erts_dir_from_default
) else (
@goto :set_erts_dir_from_erl
goto :set_erts_dir_from_erl
)
@goto :eof

Expand All @@ -57,11 +57,11 @@ cd %rootdir%
:: Set the ERTS dir from erl
:set_erts_dir_from_erl
@for /f "delims=" %%i in ('where erl') do (
@set erl=%%i
set erl=%%i
)
@set dir_cmd="%erl%" -noshell -eval "io:format(\"~s\", [filename:nativename(code:root_dir())])." -s init stop
@for /f %%i in ('%%dir_cmd%%') do (
@set erl_root=%%i
set erl_root=%%i
)
@set erts_dir=%erl_root%\erts-%erts_vsn%
@set rootdir=%erl_root%
Expand All @@ -71,15 +71,15 @@ cd %rootdir%
:find_sys_config
@set possible_sys=%rel_dir%\sys.config
@if exist "%possible_sys%" (
@set sys_config=-config "%possible_sys%"
set sys_config=-config "%possible_sys%"
)
@goto :eof

:: set boot_script variable
:set_boot_script_var
@if exist "%rel_dir%\%rel_name%.boot" (
@set boot_script=%rel_dir%\%rel_name%
set boot_script=%rel_dir%\%rel_name%
) else (
@set boot_script=%rel_dir%\start
set boot_script=%rel_dir%\start
)
@goto :eof
42 changes: 21 additions & 21 deletions priv/templates/extended_bin_windows.dtl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
:: of this script
@set script_dir=%~dp0
@for %%A in ("%script_dir%\..") do @(
@set release_root_dir=%%~fA
set release_root_dir=%%~fA
)
@set rel_dir=%release_root_dir%\releases\%rel_vsn%

Expand All @@ -44,21 +44,21 @@

:: Extract node type and name from vm.args
@for /f "usebackq tokens=1-2" %%I in (`findstr /b "\-name \-sname" "%vm_args%"`) do @(
@set node_type=%%I
@set node_name=%%J
set node_type=%%I
set node_name=%%J
)

:: Extract cookie from vm.args
@for /f "usebackq tokens=1-2" %%I in (`findstr /b \-setcookie "%vm_args%"`) do @(
@set cookie=%%J
set cookie=%%J
)

:: Write the erl.ini file to set up paths relative to this script
@call :write_ini

:: If a start.boot file is not present, copy one from the named .boot file
@if not exist "%rel_dir%\start.boot" (
@copy "%rel_dir%\%rel_name%.boot" "%rel_dir%\start.boot" >nul
copy "%rel_dir%\%rel_name%.boot" "%rel_dir%\start.boot" >nul
)

@if "%1"=="install" @goto install
Expand All @@ -81,9 +81,9 @@
:find_erts_dir
@set possible_erts_dir=%release_root_dir%\erts-%erts_vsn%
@if exist "%possible_erts_dir%" (
@call :set_erts_dir_from_default
call :set_erts_dir_from_default
) else (
@call :set_erts_dir_from_erl
call :set_erts_dir_from_erl
)
@goto :eof

Expand All @@ -96,11 +96,11 @@
:: Set the ERTS dir from erl
:set_erts_dir_from_erl
@for /f "delims=" %%i in ('where erl') do @(
@set erl=%%i
set erl=%%i
)
@set dir_cmd="%erl%" -noshell -eval "io:format(\"~s\", [filename:nativename(code:root_dir())])." -s init stop
@for /f %%i in ('%%dir_cmd%%') do @(
@set erl_root=%%i
set erl_root=%%i
)
@set erts_dir=%erl_root%\erts-%erts_vsn%
@set rootdir=%erl_root%
Expand All @@ -110,16 +110,16 @@
:find_sys_config
@set possible_sys=%rel_dir%\sys.config
@if exist %possible_sys% (
@set sys_config=-config %possible_sys%
set sys_config=-config %possible_sys%
)
@goto :eof

:: set boot_script variable
:set_boot_script_var
@if exist "%rel_dir%\%rel_name%.boot" (
@set boot_script=%rel_dir%\%rel_name%
set boot_script=%rel_dir%\%rel_name%
) else (
@set boot_script=%rel_dir%\start
set boot_script=%rel_dir%\start
)
@goto :eof

Expand All @@ -144,10 +144,10 @@
:install
@if "" == "%2" (
:: Install the service
@set args=%erl_opts% -setcookie %cookie% ++ -rootdir \"%rootdir%\"
@set start_erl=%erts_dir%\bin\start_erl.exe
@set description=Erlang node %node_name% in %rootdir%
@%erlsrv% add %service_name% %node_type% "%node_name%" -c "%description%" ^
set args=%erl_opts% -setcookie %cookie% ++ -rootdir \"%rootdir%\"
set start_erl=%erts_dir%\bin\start_erl.exe
set description=Erlang node %node_name% in %rootdir%
%erlsrv% add %service_name% %node_type% "%node_name%" -c "%description%" ^
-w "%rootdir%" -m "%start_erl%" -args "%args%" ^
-stopaction "init:stop()."
) else (
Expand Down Expand Up @@ -175,11 +175,11 @@
:: Relup and reldown
:relup
@if "" == "%2" (
@echo Missing package argument
@echo Usage: %rel_name% %1 {package base name}
@echo NOTE {package base name} MUST NOT include the .tar.gz suffix
@set ERRORLEVEL=1
@exit /b %ERRORLEVEL%
echo Missing package argument
echo Usage: %rel_name% %1 {package base name}
echo NOTE {package base name} MUST NOT include the .tar.gz suffix
set ERRORLEVEL=1
exit /b %ERRORLEVEL%
)
@%escript% "%rootdir%/bin/install_upgrade.escript" "%rel_name%" "%node_name%" "%cookie%" "%2"
@goto :eof
Expand Down

0 comments on commit 4242fc4

Please sign in to comment.