Commit 731bcaf1 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

auto-build: fixed build commands with arguments

To support relative links `readlink -f ...` was used on the build
command. The problem with this is if arguments are included in the
build command it breaks. The command line is now broken up and
`readline -e ...` run on the first part. (-e ensures that the target
exists.)
parent 349b5941
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -218,14 +218,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