forked from menpo/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.py
35 lines (26 loc) · 799 Bytes
/
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
34
#! /usr/bin/env python
"""
Usage:
build.py pelican
build.py --version
build.py -h | --help
Options:
-h, --help Show this help text
--version Show Version
"""
from __future__ import print_function
import os
from docopt import docopt
def safe_call(args_list):
from subprocess import call
# Avoid output deadlock!
# http://stackoverflow.com/questions/2561902/python-execute-process-block-till-it-exits-supress-output
null_device = open(os.devnull, 'w')
return call(args_list, bufsize=4096, stdout=null_device, stderr=null_device)
if __name__ == '__main__':
args = docopt(__doc__, version='0.0.1')
if args['pelican']:
import build_pelican
exit(build_pelican.run())
else:
exit(print(docopt(__doc__, argv='--help')))