Skip to content

Commit 55d3b8d

Browse files
committed
clean up shell scripts
1 parent 672db90 commit 55d3b8d

File tree

9 files changed

+37
-37
lines changed

9 files changed

+37
-37
lines changed

scripts/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ function build_pybind() {
7373
COMMAND="${BIN} setup.py bdist_wheel"
7474
eval "${COMMAND} --pybind-only --build-dir=docker_sapien_build"
7575

76-
PACKAGE_VERSION=`${BIN} setup.py --get-version`
76+
PACKAGE_VERSION=$(${BIN} setup.py --get-version)
7777
WHEEL_NAME="./dist/sapien-${PACKAGE_VERSION}-cp${PY_VERSION}-cp${PY_VERSION}${EXT}-linux_x86_64.whl"
7878
if test -f "$WHEEL_NAME"; then
7979
echo "$FILE exist, begin audit and repair"
8080
fi
81-
auditwheel repair ${WHEEL_NAME} --exclude 'libvulkan*' --exclude 'libOpenImageDenoise*' --internal libsapien --internal libsvulkan2
81+
auditwheel repair "${WHEEL_NAME}" --exclude 'libvulkan*' --exclude 'libOpenImageDenoise*' --internal libsapien --internal libsvulkan2
8282
}
8383

8484
build_sapien

scripts/build_aarch64.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ function build_pybind() {
7373
COMMAND="${BIN} setup.py bdist_wheel"
7474
eval "${COMMAND} --pybind-only --build-dir=docker_sapien_build"
7575

76-
PACKAGE_VERSION=`${BIN} setup.py --get-version`
76+
PACKAGE_VERSION=$(${BIN} setup.py --get-version)
7777
WHEEL_NAME="./dist/sapien-${PACKAGE_VERSION}-cp${PY_VERSION}-cp${PY_VERSION}${EXT}-linux_aarch64.whl"
7878
if test -f "$WHEEL_NAME"; then
7979
echo "$FILE exist, begin audit and repair"
8080
fi
81-
auditwheel repair ${WHEEL_NAME} --plat linux_aarch64 --exclude 'libm.so*' --exclude 'libc.so*' --exclude 'libdl.so*' --exclude 'libpthread.so*' --exclude 'libvulkan*' --exclude 'libOpenImageDenoise*' --internal libsapien --internal libsvulkan2
81+
auditwheel repair "${WHEEL_NAME}" --plat linux_aarch64 --exclude 'libm.so*' --exclude 'libc.so*' --exclude 'libdl.so*' --exclude 'libpthread.so*' --exclude 'libvulkan*' --exclude 'libOpenImageDenoise*' --internal libsapien --internal libsvulkan2
8282
}
8383

8484
build_sapien

scripts/build_mac.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ function build() {
1717
if pyenv versions | grep -q "${PY_DOT}"; then
1818
echo "Version ${PY_DOT} is installed."
1919
else
20-
pyenv install ${PY_DOT}
20+
pyenv install "${PY_DOT}"
2121
fi
22-
pyenv global ${PY_DOT}
22+
pyenv global "${PY_DOT}"
2323
python --version
2424

2525
python -m pip install setuptools wheel

scripts/docker_build_wheels.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
docker run -v `pwd`:/workspace/SAPIEN -it --rm \
4-
-u $(id -u ${USER}):$(id -g ${USER}) \
3+
docker run -v "$(pwd)":/workspace/SAPIEN -it --rm \
4+
-u "$(id -u "${USER}")":"$(id -g "${USER}")" \
55
fxiangucsd/sapien-build-env:3.7 bash -c \
66
"export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL} && cd /workspace/SAPIEN && ./scripts/build.sh $1 --profile"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

33
docker run --platform linux/arm64 -v `pwd`:/workspace/SAPIEN -it --rm \
4-
-u $(id -u ${USER}):$(id -g ${USER}) \
4+
-u "$(id -u "${USER}")":"$(id -g "${USER}")" \
55
fxiangucsd/sapien-build-env-aarch64:3.6 bash -c \
66
"export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL} && cd /workspace/SAPIEN && ./scripts/build_aarch64.sh $1 --profile"

scripts/docker_install.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
#!/bin/bash
22

3-
[[ `python -V` =~ ^Python\ 3\.([0-9]+)\..*$ ]] || echo failed to detect Python version
3+
[[ $(python -V) =~ ^Python\ 3\.([0-9]+)\..*$ ]] || echo failed to detect Python version
44

55
PYTHON_VERSION=3${BASH_REMATCH[1]}
66

7-
echo Python ${PYTHON_VERSION} detected
7+
echo Python "${PYTHON_VERSION}" detected
88

99
rm -rf sapien.egg-info
1010
rm -f wheelhouse/*.whl
1111

12-
docker run -v `pwd`:/workspace/SAPIEN -it --rm \
13-
-u $(id -u ${USER}):$(id -g ${USER}) \
12+
docker run -v "$(pwd)":/workspace/SAPIEN -it --rm \
13+
-u "$(id -u "${USER}")":"$(id -g "${USER}")" \
1414
fxiangucsd/sapien-build-env:3.7 bash -c "export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL} && cd /workspace/SAPIEN && ./scripts/build.sh ${PYTHON_VERSION}"
1515

1616
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
1717

18-
cd wheelhouse
18+
cd wheelhouse || exit 1
1919
pip3 uninstall -y sapien
20-
pip3 install *
20+
pip3 install ./*
2121

22-
cd /tmp && rm stubs -rf && python3 ${DIR}/python/stubgen.py sapien
23-
cp -r /tmp/stubs/sapien/__init__.pyi ${DIR}/python/py_package
24-
cp -r /tmp/stubs/sapien/pysapien ${DIR}/python/py_package
22+
cd /tmp && rm stubs -rf && python3 "${DIR}/python/stubgen.py" sapien
23+
cp -r /tmp/stubs/sapien/__init__.pyi "${DIR}/python/py_package"
24+
cp -r /tmp/stubs/sapien/pysapien "${DIR}/python/py_package"

scripts/docker_install_debug.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
#!/bin/bash
22

3-
[[ `python -V` =~ ^Python\ 3\.([0-9]+)\..*$ ]] || echo failed to detect Python version
3+
[[ $(python -V) =~ ^Python\ 3\.([0-9]+)\..*$ ]] || echo failed to detect Python version
44

55
PYTHON_VERSION=3${BASH_REMATCH[1]}
66

7-
echo Python ${PYTHON_VERSION} detected
7+
echo Python "${PYTHON_VERSION}" detected
88

9-
docker run -v `pwd`:/workspace/SAPIEN -it --rm \
10-
-u $(id -u ${USER}):$(id -g ${USER}) \
9+
docker run -v "$(pwd)":/workspace/SAPIEN -it --rm \
10+
-u "$(id -u "${USER}")":"$(id -g "${USER}")" \
1111
fxiangucsd/sapien-build-env:3.7 bash -c "export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL} && cd /workspace/SAPIEN && ./scripts/build.sh ${PYTHON_VERSION} --debug"
1212

1313
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
1414

15-
cd wheelhouse
15+
cd wheelhouse || exit 1
1616
pip3 uninstall -y sapien
17-
pip3 install *
17+
pip3 install ./*
1818

19-
cd /tmp && rm stubs -rf && python3 ${DIR}/python/stubgen.py sapien.core --ignore-invalid all
20-
cp /tmp/stubs/sapien/core-stubs/__init__.pyi $DIR/python/py_package/core
21-
cp -r /tmp/stubs/sapien/core-stubs/pysapien $DIR/python/py_package/core
19+
cd /tmp && rm stubs -rf && python3 "${DIR}/python/stubgen.py" sapien.core --ignore-invalid all
20+
cp /tmp/stubs/sapien/core-stubs/__init__.pyi "${DIR}/python/py_package/core"
21+
cp -r /tmp/stubs/sapien/core-stubs/pysapien "${DIR}/python/py_package/core"

scripts/install.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ python3 setup.py bdist_wheel
77

88
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
99

10-
cd dist
10+
cd dist || exit 1
1111
pip3 uninstall -y sapien
12-
pip3 install *
12+
pip3 install ./*
1313

14-
cd /tmp && rm stubs -rf && python3 ${DIR}/python/stubgen.py sapien.core --ignore-invalid all
15-
cp /tmp/stubs/sapien/core-stubs/__init__.pyi $DIR/python/py_package/core
16-
cp -r /tmp/stubs/sapien/core-stubs/pysapien $DIR/python/py_package/core
14+
cd /tmp && rm stubs -rf && python3 "${DIR}/python/stubgen.py" sapien.core --ignore-invalid all
15+
cp /tmp/stubs/sapien/core-stubs/__init__.pyi "${DIR}/python/py_package/core"
16+
cp -r /tmp/stubs/sapien/core-stubs/pysapien "${DIR}/python/py_package/core"

scripts/install_debug.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ python3 setup.py bdist_wheel --debug --profile
77

88
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
99

10-
cd dist
10+
cd dist || exit 1
1111
pip3 uninstall -y sapien
12-
pip3 install *
12+
pip3 install ./*
1313

14-
cd /tmp && rm stubs -rf && python3 ${DIR}/python/stubgen.py sapien
15-
cp -r /tmp/stubs/sapien/__init__.pyi ${DIR}/python/py_package
16-
cp -r /tmp/stubs/sapien/pysapien ${DIR}/python/py_package
14+
cd /tmp && rm stubs -rf && python3 "${DIR}/python/stubgen.py" sapien
15+
cp -r /tmp/stubs/sapien/__init__.pyi "${DIR}/python/py_package"
16+
cp -r /tmp/stubs/sapien/pysapien "${DIR}/python/py_package"

0 commit comments

Comments
 (0)