Skip to content
Snippets Groups Projects
Commit 6ac1f433 authored by Steffen Müthing's avatar Steffen Müthing
Browse files

[dunecontrol] Improve path quoting in vcsetup command

Make sure to always quote paths that are relative to PREFIX_DIR, as that variable
may contain spaces.
parent bcde7bfa
No related branches found
No related tags found
No related merge requests found
......@@ -364,14 +364,14 @@ run_default_vcsetup() {
if [ ! -e "$GITHOOKPATH" ]; then
# there is no hook yet, we can safely install ours
echo "--> Installing Git pre-commit hook to enforce whitespace policy"
cp -p $PREFIX_DIR/bin/git-whitespace-hook "$GITHOOKPATH"
cp -p "$PREFIX_DIR/bin/git-whitespace-hook" "$GITHOOKPATH"
else
# there is already a hook, check whether it is our whitespace hook
local HOOKTAG="$(eval head -n 2 \"$GITHOOKPATH\" | tail -n 1)"
if [ "x$HOOKTAG" = "x# dune-git-whitespace-hook" ]; then
if [ $PREFIX_DIR/bin/git-whitespace-hook -nt "$GITHOOKPATH" ]; then
if [ "$PREFIX_DIR/bin/git-whitespace-hook" -nt "$GITHOOKPATH" ]; then
echo "--> Updating Git pre-commit hook with newer version"
cp -p $PREFIX_DIR/bin/git-whitespace-hook "$GITHOOKPATH"
cp -p "$PREFIX_DIR/bin/git-whitespace-hook" "$GITHOOKPATH"
fi
else
echo "WARNING: Existing pre-commit hook found!"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment