diff --git a/build-cran-package.sh b/build-cran-package.sh index 04f207523aa6..06074e549966 100755 --- a/build-cran-package.sh +++ b/build-cran-package.sh @@ -63,7 +63,7 @@ CURRENT_DATE=$(date +'%Y-%m-%d') # R packages cannot have versions like 3.0.0rc1, but # 3.0.0-1 is acceptable -LGB_VERSION=$(sed "s/rc/-/g" < VERSION.txt) +LGB_VERSION=$(head -1 ./VERSION.txt | sed "s/rc/-/g") # move relevant files cp -R R-package/* "${TEMP_R_DIR}" @@ -153,7 +153,6 @@ cd "${TEMP_R_DIR}" -e 's/^.*#pragma endregion.*$//' \ -e 's/^.*#pragma warning.*$//' \ {} + - find . -name '*.bak' -exec rm {} \; # 'processx' is listed as a 'Suggests' dependency in DESCRIPTION # because it is used in install.libs.R, a file that is not @@ -164,7 +163,7 @@ cd "${TEMP_R_DIR}" DESCRIPTION echo "Cleaning sed backup files" - rm ./*.bak + find . -name '*.bak' -exec rm {} \; cd "${ORIG_WD}" diff --git a/build-python.sh b/build-python.sh index 68d1fc15095e..cf790737729e 100755 --- a/build-python.sh +++ b/build-python.sh @@ -340,20 +340,22 @@ fi if test "${BUILD_SDIST}" = true; then echo "--- building sdist ---" rm -f ../dist/*.tar.gz + # shellcheck disable=SC2086 python -m build \ --sdist \ --outdir ../dist \ - ${BUILD_ARGS:+${BUILD_ARGS}} \ + ${BUILD_ARGS} \ . fi if test "${BUILD_WHEEL}" = true; then echo "--- building wheel ---" rm -f ../dist/*.whl || true + # shellcheck disable=SC2086 python -m build \ --wheel \ --outdir ../dist \ - ${BUILD_ARGS:+${BUILD_ARGS}} \ + ${BUILD_ARGS} \ . fi @@ -366,8 +368,9 @@ if test "${INSTALL}" = true; then PACKAGE_NAME="$(echo lightgbm*.tar.gz)" fi # ref for use of '--find-links': https://stackoverflow.com/a/52481267/3986677 + # shellcheck disable=SC2086 pip install \ - ${PIP_INSTALL_ARGS:+ -o "$PIP_INSTALL_ARGS"} \ + ${PIP_INSTALL_ARGS} \ --force-reinstall \ --no-cache-dir \ --no-deps \