Skip to content

Commit

Permalink
Make the pre-push script work on directories with spaces
Browse files Browse the repository at this point in the history
As a secondary benefit, it's also a lot simpler.
  • Loading branch information
jyn514 committed Dec 17, 2022
1 parent 2d76a9d commit c754d05
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/etc/pre-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,8 @@ set -Eeuo pipefail
# https://github.com/rust-lang/rust/issues/77620#issuecomment-705144570
unset GIT_DIR
ROOT_DIR="$(git rev-parse --show-toplevel)"
COMMAND="$ROOT_DIR/x.py test tidy"

if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then
COMMAND="python $COMMAND"
elif ! command -v python &> /dev/null; then
COMMAND="python3 $COMMAND"
fi

echo "Running pre-push script '$COMMAND'"
echo "Running pre-push script $ROOT_DIR/x test tidy"

cd "$ROOT_DIR"

$COMMAND
./x test tidy

0 comments on commit c754d05

Please sign in to comment.