occlum/.githooks/post-commit
LI Qing 488ec48fe7 Upgrade Rust SGX SDK and its deps to the latest
1. Upgrade Rust SGX SDK to v1.1.0
2. Upgrade Intel SGX SDK to v2.7.1
3. Upgrade Rust to nightly-2019-11-25
2020-01-23 04:40:54 +00:00

21 lines
420 B
Bash
Executable File

#!/bin/bash
cd src/libos
output=$(cargo fmt -- --check 2>&1)
retval=$?
if [[ $retval -eq 0 ]]
then
exit 0
elif [[ $retval -eq 1 ]]
then
echo "Rust format suggestsions (generated by \`cd src/libos && cargo fmt -- --check\`):"
echo
echo "$output"
echo
echo "To get rid of the format warnings above, run \`cargo fmt\` before the next commit."
exit 1
else
echo "Warning: \`cargo fmt\` is not available."
exit 1
fi