mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-22 22:45:31 +01:00
[CI-SKIP] fixed sed -i for bsd sed (#4782)
This commit is contained in:
parent
7ae47d4eb3
commit
e6d7bdca1d
1 changed files with 13 additions and 1 deletions
|
@ -11,6 +11,18 @@ nms="$spigotdecompiledir/net/minecraft/server"
|
||||||
cb="src/main/java/net/minecraft/server"
|
cb="src/main/java/net/minecraft/server"
|
||||||
gitcmd="git -c commit.gpgsign=false"
|
gitcmd="git -c commit.gpgsign=false"
|
||||||
|
|
||||||
|
# https://stackoverflow.com/a/38595160
|
||||||
|
# https://stackoverflow.com/a/800644
|
||||||
|
if sed --version >/dev/null 2>&1; then
|
||||||
|
strip_cr() {
|
||||||
|
sed -i -- "s/\r//" "$@"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
strip_cr () {
|
||||||
|
sed -i "" "s/$(printf '\r')//" "$@"
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
patch=$(which patch 2>/dev/null)
|
patch=$(which patch 2>/dev/null)
|
||||||
if [ "x$patch" == "x" ]; then
|
if [ "x$patch" == "x" ]; then
|
||||||
patch="$basedir/hctap.exe"
|
patch="$basedir/hctap.exe"
|
||||||
|
@ -53,7 +65,7 @@ do
|
||||||
|
|
||||||
echo "Patching $file < $patchFile"
|
echo "Patching $file < $patchFile"
|
||||||
set +e
|
set +e
|
||||||
sed -i 's/\r//' "$nms/$file" > /dev/null
|
strip_cr "$nms/$file" > /dev/null
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
"$patch" -s -d src/main/java/ "net/minecraft/server/$file" < "$patchFile"
|
"$patch" -s -d src/main/java/ "net/minecraft/server/$file" < "$patchFile"
|
||||||
|
|
Loading…
Reference in a new issue