mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-28 22:25:32 -04:00
Retrieve error code via PIPESTATUS
This commit is contained in:
parent
5671e2c755
commit
27b758b4a0
1 changed files with 6 additions and 2 deletions
|
|
@ -536,14 +536,18 @@ fi
|
|||
|
||||
# CMake build step
|
||||
echo -e '\n*** Compiling CP2K ***\n'
|
||||
if ! cmake --build "${CMAKE_BUILD_PATH}" --parallel "${NUM_PROCS}" -- "${VERBOSE_FLAG}" |& tee "${CMAKE_BUILD_PATH}/ninja.log"; then
|
||||
cmake --build "${CMAKE_BUILD_PATH}" --parallel "${NUM_PROCS}" -- "${VERBOSE_FLAG}" |& tee "${CMAKE_BUILD_PATH}"/ninja.log
|
||||
EXIT_CODE=${PIPESTATUS[0]}
|
||||
if ((EXIT_CODE != 0)); then
|
||||
echo "ERROR: The CMake build step failed with the error code ${EXIT_CODE}"
|
||||
${EXIT_CMD} "${EXIT_CODE}"
|
||||
fi
|
||||
|
||||
# CMake install step
|
||||
echo -e '\n*** Installing CP2K ***\n'
|
||||
if ! cmake --install "${CMAKE_BUILD_PATH}" |& tee "${CMAKE_BUILD_PATH}/install.log"; then
|
||||
cmake --install "${CMAKE_BUILD_PATH}" |& tee "${CMAKE_BUILD_PATH}"/install.log
|
||||
EXIT_CODE=${PIPESTATUS[0]}
|
||||
if ((EXIT_CODE != 0)); then
|
||||
echo "ERROR: The CMake installation step failed with the error code ${EXIT_CODE}"
|
||||
${EXIT_CMD} "${EXIT_CODE}"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue