This website requires JavaScript.
55e6021ce36b2f2d4ef9222252b9ab784f67d9f7
nova /tools /enable-pre-commit-hook.sh
2011年10月17日 14:17:52 -05:00
#!/bin/sh
# Copyright 2011 OpenStack LLC
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
PRE_COMMIT_SCRIPT=.git/hooks/pre-commit
echo "exec ./run_tests.sh -N -p" >> $PRE_COMMIT_SCRIPT
chmod +x $PRE_COMMIT_SCRIPT
if [ -w $PRE_COMMIT_SCRIPT -a -x $PRE_COMMIT_SCRIPT ]; then
echo "pre-commit hook was created successfully"
echo "unable to create pre-commit hook"
# NOTE(jk0): Make sure we are in nova's root directory before adding the hook.
echo "unable to find .git; moving up a directory"
echo "still unable to find .git; hook not created"