view tpc @ 280:23b52d2d05a0

Don't try to replace self in a macro expansion since it's unlikely to be the desired behavior. A more explicit means of specifying what variables should be replaced in a quote expression is needed.
author Michael Pavone <pavone@retrodev.com>
date Mon, 21 Jul 2014 19:30:23 -0700
parents c801dccdb4fb
children
line wrap: on
line source

#!/bin/sh

args=
dir=`dirname $0`
while [ $# -gt 0 ]; do
	if [ "-o" = "$1" ]; then
		shift
		output="$1"
	else	
		args="$args $1"
	fi
	shift
done

if [ $output ]; then
	if d8 $dir/tpc.js -- $args > $output; then
		exit
	else
		code=$?
		cat $output 1>&2
		rm -f $output
		exit $code
	fi
else
	d8 $dir/tpc.js -- $args
fi