Ensure all helper scripts pushd/popd
Make sure all of these move to the root of the repository first, then return to where they were afterwards, using pushd/popd. This allows them to be executed from anywhere in the repo.
This commit is contained in:
4
format
4
format
@ -5,10 +5,14 @@ if ! which black &>/dev/null; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
pushd $( git rev-parse --show-toplevel ) &>/dev/null
|
||||
|
||||
echo "Formatting..."
|
||||
black --safe --exclude api-daemon/migrations .
|
||||
ret=$?
|
||||
if [[ $ret -eq 0 ]]; then
|
||||
echo "Successfully formatted project!"
|
||||
fi
|
||||
|
||||
popd &>/dev/null
|
||||
exit $ret
|
||||
|
Reference in New Issue
Block a user