Commit 7b75dbeb authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Merge branch 'hotfix/0.1.1'

parents 216294f3 e10d3395
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

AC_INIT([git-hooks], [0.1.0])
AC_INIT([git-hooks], [0.1.1])
AM_INIT_AUTOMAKE

gitcoredir=`git --exec-path`
+8 −3
Original line number Diff line number Diff line
@@ -188,14 +188,18 @@ build ()
	done
	trap "[ -L '$lock' ] && rm '$lock'" EXIT

	# create the build dir if it does not exist
	# create the build dir if it does not exist & remove any stickbits set by 
	# the parent; prevents permissions from being forced to values that may 
	# affect the build
	if ! [ -e "$dir" ]; then
		mkdir -p "$dir"
		chmod g-s "$dir"
	elif ! [ -d "$dir" ]; then
		echo "the build directory $dir exists but is not a directory" >&2
		return 1
	fi


	# create the git repository if it does not exist
	is_git_workspace "$dir" || git clone "$GIT_DIR" "$dir" >&2

@@ -218,14 +222,15 @@ build ()

	# normalise $cmd
	pushd "$GIT_DIR" >/dev/null
	cmd=`readlink -f "$cmd"`
	eval cmd=( $cmd )
	cmd[0]=`readlink -e "${cmd[0]}" || echo "${cmd[0]}"`
	popd >/dev/null

	# run the build command
	(
		export AUTO_BUILD_BASE="$GIT_DIR"
		unset GIT_DIR
		if ! eval $cmd >&2; then
		if ! "${cmd[@]}" >&2; then
			echo "command failed: $cmd" >&2
			return 1
		fi