aboutsummaryrefslogblamecommitdiffstats
path: root/bin/ssg
blob: 904245b7bde892e0e17afd051d8eb22b5434be2b (plain) (tree)
1
2
3
4
5
6
7
8
9

         
          
 
       
 
                    
                                      
                    


                    
 



                                           
 



                                     



                                                                              
#!/bin/sh

. bin/func

set -xe

media_branch="media"
src_files="$(__list_files ${src_dir})"
dirs="${media_dir} \
	${src_dir} \
	${tmp_dir} \
	${out_dir}"

# Ensure directories exist.
for dir in ${dirs}; do
	[ ! -d "${dir}" ] && mkdir "${dir}"
done

# Generate output files from sources.
for src_file in ${src_files}; do
	__handle "${src_file}"
done

if git rev-parse media; then
	git --work-tree="${out_dir}" checkout "${media_branch}" "${media_dir}"
fi
remember that computers suck.