-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.py
33 lines (27 loc) · 1.03 KB
/
build.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/opt/conda/bin/python
#######################
#
# This is the main build script for this repository.
# To understand the build process, read the comments on each section below,
# then dive into the how_to_data module, where the major content resides.
#
#######################
import how_to_data
import sys
import log
# Command line parameters
# -f/--force = rerun all solution code even if modification dates don't require it
# -j/--no-jekyll = stop after building database into jekyll_input folder; don't run Jekyll
rerun_solutions = '-f' in sys.argv or '--force' in sys.argv
skip_jekyll = '-j' in sys.argv or '--no-jekyll' in sys.argv
quiet = '-v' not in sys.argv and '--verbose' not in sys.argv
# Build Jekyll input from database
how_to_data.database_to_jekyll( rerun_solutions, quiet )
# Run Jekyll on newly copied files
if skip_jekyll:
log.heading( 'Skipping Jekyll build process' )
else:
log.heading( 'Running Jekyll build process' )
how_to_data.jekyll_to_site()
# State completion
log.heading( 'Build completed successfully.' )