~ecs/wersh

b5d8cd01174d479611287a10b08b511d11d0e130 — Eyal Sawady 2 months ago 0ab2c0a master
Miscellaneous fixes
1 files changed, 8 insertions(+), 8 deletions(-)

M wersh
M wersh => wersh +8 -8
@@ 18,7 18,7 @@ do
	case $arg in
		-s)
			_single=t
			_n=$(($_n + 1))
			_n=$((_n + 1))
			;;
		-*)
			usage


@@ 34,15 34,15 @@ render() {
_rendering=
content=
emit() {
	if [ "$_rendering" == "t" ]
	if [ "$_rendering" = "t" ]
	then
		printf "%s\n" "$@"
	elif [ "z$content" == "z" ]
	elif [ "z$content" = "z" ]
	then
		content="$@"
		content="$*"
	else
		content="$content
$@"
$*"
	fi
}



@@ 83,12 83,12 @@ else
		rm -rf "$_outputdir"
	fi
	find "$root" -type f -name "*.w" -not -path "*/_*/*" -not -name "_*" -not -path "/.*" \
	| while read _input
	| while read -r _input
	do
		_output="$_outputdir${_input#$root}"
		_output="${_output%.w}"
		echo "Generating $_output from $_input"
		mkdir -p $(dirname "$_output")
		mkdir -p "$(dirname "$_output")"
		$0 -s "$root" "$_outputdir" "$_output" "${_input#$root/}" > "$_output"
	done
	find "$root" -type f -not -name "*.w" -not -path "*/_*/*" -not -name "_*" -not -path "*/.*" \


@@ 96,7 96,7 @@ else
	do
		_output="$_outputdir${_input#$root}"
		echo "Copying $_input to $_output"
		mkdir -p $(dirname "$_output")
		mkdir -p "$(dirname "$_output")"
		cp "$_input" "$_output"
	done
fi