Skip to content

Commit

Permalink
fix: Guarantee the dist command generates correct newline
Browse files Browse the repository at this point in the history
  • Loading branch information
tomghuang committed Jan 16, 2021
1 parent 9465311 commit aac9cff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions tools/build
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ dist () {
cp -r ../examples ../dist
rm -rf ../dist/examples/bin
rm -rf ../dist/examples/build
find ../dist -name '*' | xargs dos2unix
}

get_ver () {
Expand All @@ -84,7 +85,6 @@ elif [ "$1" = "cleanall" ]; then
elif [ "$1" = "tar" ]; then
dist
ver=$(get_ver)
find ../dist -name '*' | xargs dos2unix
tar -cvzf argtable-$ver-amalgamation.tar.gz ../dist
exit 0
elif [ "$1" = "zip" ]; then
Expand All @@ -103,9 +103,11 @@ elif [ "$1" = "help" ]; then
echo "Usage: build <command>"
echo ""
echo "Available commands:"
echo " dist build the amalgamation package"
echo " cleanall delete all generated folders/files"
echo " help display usage information"
echo " dist build the amalgamation package"
echo " tar build the amalgamation package in UNIX archive format"
echo " zip build the amalgamation package in Windows archive format"
echo " cleanall delete all generated folders/files"
echo " help display usage information"
exit 0
else
echo "Unknown command"
Expand Down
10 changes: 6 additions & 4 deletions tools/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@ echo.
echo Usage: build ^<command^>
echo.
echo Available commands:
echo dist build the amalgamation package
echo cleanall delete all generated folders/files
echo help display usage information
echo dist build the amalgamation package
echo tar build the amalgamation package in UNIX archive format
echo zip build the amalgamation package in Windows archive format
echo cleanall delete all generated folders/files
echo help display usage information
goto :EOF


Expand Down Expand Up @@ -99,6 +101,7 @@ copy ..\README.md ..\dist
xcopy ..\tests ..\dist\tests\ /H /K /Y
copy ..\src\argtable3_private.h ..\dist\tests
xcopy ..\examples ..\dist\examples\ /H /K /Y
for /R ..\dist %%G in (*) do unix2dos "%%G"
goto :EOF


Expand All @@ -122,7 +125,6 @@ goto :EOF
:build_zip
call:dist
call:get_ver
for /R ..\dist %%G in (*) do unix2dos "%%G"
zip -r argtable-%ARGTABLE_VER%-amalgamation.zip ..\dist
goto :EOF

Expand Down

0 comments on commit aac9cff

Please sign in to comment.