Skip to content

Commit

Permalink
Windows: enforce carriage return for .bat files (spack#35514)
Browse files Browse the repository at this point in the history
Batch scripts in general will not function without carriage return line
endings on Windows. We rely on these scripts to support cmd, so we
should not allow these scripts to be converted to lf.

Note: Windows 11 supports lf line endings due to the use of Windows
Terminal. Once support for Windows 10 is dropped, this change can be
reverted.
  • Loading branch information
johnwparent authored Feb 17, 2023
1 parent 9f3f4b3 commit 573f7bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.py diff=python
*.lp linguist-language=Prolog
lib/spack/external/* linguist-vendored
*.bat text eol=crlf
2 changes: 1 addition & 1 deletion bin/spack.bat
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ for %%Z in ("%_pa_new_path%") do if EXIST %%~sZ\NUL (
exit /b 0

:: set module system roots
:_sp_multi_pathadd
:_sp_multi_pathadd
for %%I in (%~2) do (
for %%Z in (%_sp_compatible_sys_types%) do (
:pathadd "%~1" "%%I\%%Z"
Expand Down

0 comments on commit 573f7bf

Please sign in to comment.