Skip to content

Commit ecae120

Browse files
NickVolynkinp7nov
authored andcommitted
Use strict error handling in bash scripts (#3083)
1 parent 3c6894c commit ecae120

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

build_submodules.sh

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
set -xe
3+
set -xe -o pipefail -o nounset
44

55
project_root=$(pwd)
66

@@ -31,14 +31,14 @@ cartridge_pot_src="${cartridge_root}/build.luarocks/build.rst/locale"
3131
cartridge_pot_dest="${project_root}/locale/book/cartridge"
3232
cd "${cartridge_pot_src}" || exit
3333
mkdir -p "${cartridge_pot_dest}"
34-
find . -name '*.pot' -exec cp -r --parents {} "${cartridge_pot_dest}" \;
34+
find . -name '*.pot' -exec cp -rv --parents {} "${cartridge_pot_dest}" \;
3535

3636
# Copy translations
3737
cartridge_po_src="${cartridge_root}/build.luarocks/build.rst/locale/ru/LC_MESSAGES"
3838
cartridge_po_dest="${po_dest}/book/cartridge"
3939
cd "${cartridge_po_src}" || exit
4040
mkdir -p "${cartridge_po_dest}"
41-
find . -name '*.po' -exec cp -r --parents {} "${cartridge_po_dest}" \;
41+
find . -name '*.po' -exec cp -rv --parents {} "${cartridge_po_dest}" \;
4242

4343

4444
# Cartridge CLI
@@ -67,8 +67,8 @@ monitoring_grafana_root="${project_root}/modules/grafana-dashboard/doc/monitorin
6767

6868
# Copy monitoring docs to the right destination
6969
mkdir -p "${monitoring_dest}"
70-
yes | cp -rf "${monitoring_root}" "${monitoring_dest}/"
71-
yes | cp -rf "${monitoring_grafana_root}" "${monitoring_dest}/"
70+
cp -rfv "${monitoring_root}" "${monitoring_dest}/"
71+
cp -rfv "${monitoring_grafana_root}" "${monitoring_dest}/"
7272

7373

7474
# Luatest
@@ -81,10 +81,10 @@ ldoc --ext=rst --dir=rst --toctree="API" .
8181

8282
# Copy Luatest docs to the right place
8383
cd "${luatest_dest}"
84-
yes | cp -fa "${luatest_root}/rst/." "${luatest_dest}"
85-
yes | cp "${luatest_root}/README.rst" "${luatest_dest}"
84+
cp -fa "${luatest_root}/rst/." "${luatest_dest}"
85+
cp "${luatest_root}/README.rst" "${luatest_dest}"
8686
mkdir -p "${luatest_dest}/_includes/"
87-
yes | mv -f "${luatest_dest}/index.rst" "${luatest_dest}/_includes/"
87+
mv -fv "${luatest_dest}/index.rst" "${luatest_dest}/_includes/"
8888

8989

9090
# Kubernetes operator
@@ -93,7 +93,7 @@ cartridge_kubernetes_dest="${cartridge_rst_dest}/"
9393

9494
# Copy Kubernetes operator docs to the right place
9595
mkdir -p "${cartridge_kubernetes_dest}"
96-
yes | cp -rf "${cartridge_kubernetes_root}" "${cartridge_kubernetes_dest}"
96+
cp -rfv "${cartridge_kubernetes_root}" "${cartridge_kubernetes_dest}"
9797

9898

9999
# Tarantool C++ connector
@@ -104,6 +104,6 @@ tntcxx_api_dest="${project_root}/doc/book/connectors"
104104
# Copy Tarantool C++ connector docs to the right places
105105
mkdir -p "${tntcxx_api_dest}/cxx/"
106106
mkdir -p "${tntcxx_howto_dest}/_includes"
107-
yes | cp -rf "${tntcxx_root}/doc/tntcxx_getting_started.rst" "${tntcxx_howto_dest}/getting_started_cxx.rst"
108-
yes | cp -rf "${tntcxx_root}/examples/" "${tntcxx_howto_dest}/_includes/examples/"
109-
yes | cp -rf "${tntcxx_root}/doc/tntcxx_api.rst" "${tntcxx_api_dest}/cxx/"
107+
cp -rfv "${tntcxx_root}/doc/tntcxx_getting_started.rst" "${tntcxx_howto_dest}/getting_started_cxx.rst"
108+
cp -rfv "${tntcxx_root}/examples/" "${tntcxx_howto_dest}/_includes/examples/"
109+
cp -rfv "${tntcxx_root}/doc/tntcxx_api.rst" "${tntcxx_api_dest}/cxx/"

0 commit comments

Comments
 (0)