]> scripts.mit.edu Git - wizard.git/blob - wizard/command/prepare_new.py
fa302b88507fae4595ee283b8e3ae04b8989df49
[wizard.git] / wizard / command / prepare_new.py
1 import os
2 import os.path
3
4 from wizard import command
5
6 def main(argv, baton):
7     options, args = parse_args(argv, baton)
8     if not os.path.exists(".git"):
9         raise Exception("Not in root directory of Git working copy")
10     os.mkdir(".scripts")
11     open(".scripts/.htaccess", "w").write("Deny from all\n")
12
13 def parse_args(argv, baton):
14     usage = """usage: %prog prepare-new
15
16 Creates a .scripts directory and standard files that live in it.
17 """
18     parser = command.WizardOptionParser(usage)
19     options, args = parser.parse_all(argv)
20     if len(args):
21         parser.error("too many arguments")
22     return options, args