Build solutions too
This commit is contained in:
		
							
								
								
									
										41
									
								
								build.sh
									
									
									
									
									
								
							
							
						
						
									
										41
									
								
								build.sh
									
									
									
									
									
								
							| @ -13,19 +13,40 @@ function build() { | ||||
| 	echo "|> Building ${job_name}..." | ||||
| 	cd "${doc_dir}" | ||||
|  | ||||
| 	tectonic \ | ||||
| 		--outfmt pdf \ | ||||
| 		--chatter minimal \ | ||||
| 		main.tex | ||||
|  | ||||
| 	# Build handout | ||||
| 	echo "\\def\\argNoSolutions{1}\\input{main.tex}" | \ | ||||
| 		tectonic \ | ||||
| 			--outfmt pdf \ | ||||
| 			--chatter minimal \ | ||||
| 			- | ||||
|  | ||||
| 	stat=$? | ||||
|  | ||||
| 	if [[ $stat == 0 ]]; then | ||||
| 		mv main.pdf "${OUTPUT}/${job_name}.pdf" | ||||
| 		mv texput.pdf "${OUTPUT}/${job_name}.pdf" | ||||
| 	else | ||||
| 		rm -f texput.pdf | ||||
| 		echo "|> Handout build failed" | ||||
| 		echo "" | ||||
| 	fi | ||||
|  | ||||
|  | ||||
| 	# Build solutions | ||||
| 	echo "\\def\\argYesSolutions{1}\\input{main.tex}" | \ | ||||
| 		tectonic \ | ||||
| 			--outfmt pdf \ | ||||
| 			--chatter minimal \ | ||||
| 			- | ||||
|  | ||||
| 	stat=$? | ||||
|  | ||||
| 	if [[ $stat == 0 ]]; then | ||||
| 		mv texput.pdf "${OUTPUT}/${job_name}.sols.pdf" | ||||
| 		echo "" | ||||
| 	else | ||||
| 		rm -f main.pdf | ||||
| 		echo "|> Build failed" | ||||
| 		rm -f texput.pdf | ||||
| 		echo "|> Solution build failed" | ||||
| 		echo "" | ||||
| 	fi | ||||
|  | ||||
| @ -33,6 +54,8 @@ function build() { | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| for d in ./Advanced/*/ ; do | ||||
| 	doc_dir=$(realpath "${d}") | ||||
| 	OUTPUT="${run_dir}/${target}/Advanced" | ||||
| @ -41,6 +64,7 @@ for d in ./Advanced/*/ ; do | ||||
| 	build "${doc_dir}/main.tex" | ||||
| done | ||||
|  | ||||
|  | ||||
| for d in ./Intermediate/*/ ; do | ||||
| 	doc_dir=$(realpath "${d}") | ||||
| 	OUTPUT="${run_dir}/${target}/Intermediate" | ||||
| @ -49,5 +73,8 @@ for d in ./Intermediate/*/ ; do | ||||
| 	build "${doc_dir}/main.tex" | ||||
| done | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| cd "${target}" | ||||
| zip -FSr ../output.zip . | ||||
		Reference in New Issue
	
	Block a user