Skip to content

Commit

Permalink
Quote paths in batch
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterDA committed Feb 1, 2023
1 parent 3ab55f6 commit 8099bb6
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions static/extract.cmd
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
@echo off

copy C:\cygwin64\bin\basename.exe %DESTINATION%
copy C:\cygwin64\bin\bash.exe %DESTINATION%
copy C:\cygwin64\bin\cygpath.exe %DESTINATION%
copy C:\cygwin64\bin\readlink.exe %DESTINATION%
copy C:\cygwin64\bin\tar.exe %DESTINATION%
copy C:\cygwin64\bin\sha256sum.exe %DESTINATION%
echo Copying to "%DESTINATION%"
copy /v /b C:\cygwin64\bin\basename.exe "%DESTINATION%"
copy /v /b C:\cygwin64\bin\bash.exe "%DESTINATION%"
copy /v /b C:\cygwin64\bin\cygpath.exe "%DESTINATION%"
copy /v /b C:\cygwin64\bin\readlink.exe "%DESTINATION%"
copy /v /b C:\cygwin64\bin\tar.exe "%DESTINATION%"
copy /v /b C:\cygwin64\bin\sha256sum.exe "%DESTINATION%"

for /f "usebackq delims=" %%f in (`C:\cygwin64\bin\bash.exe -lc "ldd -- /bin/basename.exe /bin/bash.exe /bin/cygpath.exe /bin/readlink.exe /bin/tar.exe /bin/sha256sum.exe | sed -ne 's|.* => \(/usr/bin/.*\) ([^)]*)$|\1|p' | sort -u | xargs cygpath -w"`) do (
echo Copying %%f
copy %%f %DESTINATION%
echo Copying "%%f" to "%DESTINATION%"
copy /v /b "%%f" "%DESTINATION%"
)

0 comments on commit 8099bb6

Please sign in to comment.