Skip to content

Commit

Permalink
Docs generation script: require version number an argument
Browse files Browse the repository at this point in the history
- eliminates the need to run the script when the tree is at a particular version
  • Loading branch information
timsutton committed Jul 24, 2014
1 parent 1e755d8 commit bfe00ee
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions Scripts/generate_processor_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
code_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../Code"))
sys.path.append(code_dir)
from autopkglib import get_processor, \
processor_names, \
get_autopkg_version
processor_names

# Additional helper function(s) from the CLI tool
# Don't make an "autopkgc" file
Expand Down Expand Up @@ -90,17 +89,26 @@ def indent_length(line_str):


def main(argv):
p = optparse.OptionParser()
usage = """%prog VERSION
..where VERSION is the release version for which docs are being generated."""
p = optparse.OptionParser(usage=usage)
p.description = (
"Generate GitHub Wiki documentation from the core processors present "
"in autopkglib. The autopkg.wiki repo is cloned locally, changes are "
"committed and the user is interactively given the option to push it "
"to the remote.")
"committed, a diff shown and the user is interactively given the "
"option to push to the remote.")
p.add_option("-d", "--directory", metavar="CLONEDIRECTORY",
help=("Directory path in which to clone the repo. If not "
"specified, a temporary directory will be used."))
options, arguments = p.parse_args()

if len(arguments) < 1:
p.print_usage()
exit()

# Grab the version for the commit log.
version = arguments[0]

print "Cloning AutoPkg wiki.."
print

Expand Down Expand Up @@ -189,9 +197,6 @@ def main(argv):
with open(sidebar_path, "w") as fd:
fd.write(new_sidebar)

# Grab the version for the commit log.
version = get_autopkg_version()

# Git commit everything
os.chdir(output_dir)
run_git([
Expand Down

0 comments on commit bfe00ee

Please sign in to comment.