Commit 874ff5c7 authored by Michael Murtaugh's avatar Michael Murtaugh
Browse files

smake!

parent e504d77e
#!/usr/bin/env python3
import sys, subprocess, os
def main (args):
datapath = os.path.join(os.path.dirname(os.path.realpath(__file__)), "data")
sconstruct_path = os.path.join(datapath, "templates", "Sconstruct.py")
template_path = os.path.join(datapath, "templates", "index-scons.html")
env = os.environ.copy()
env['scons-template'] = template_path
p = subprocess.run(["scons", "-f", sconstruct_path], env=env)
def add_subparser (subparsers):
p = subparsers.add_parser('smake', help='Use scons to make directory indexes')
# p.add_argument("path")
p.set_defaults(func=main)
if __name__ == "__main__":
from argparse import ArgumentParser
p = argparse.ArgumentParser("")
subparsers = p.add_subparsers(help="subcommands")
add_subparser(subparsers)
main(p.parse_args(args=(["smake"] + sys.argv[1:])))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment