Permalink
Browse files

Start work on the auto merging

  • Loading branch information...
1 parent 7c1b9bc commit 4ca7bf22fd80fdbe6185a6417c2f1c04185f24c8 @BonsaiDen committed Feb 13, 2011
Showing with 30 additions and 1 deletion.
  1. +30 −1 make
View
31 make
@@ -2,6 +2,8 @@
import markdown
import shutil
import os
+import sys
+import subprocess
def create_index():
articles = []
@@ -73,6 +75,33 @@ def to_markdown(text):
return markdown.markdown(text, ['abbr'])
+def merge_pages():
+ git = subprocess.Popen(['git', 'status'], stdout=subprocess.PIPE)
+
+ result = git.communicate()[0].strip().split('\n')
+ if not result[-1].startswith('nothing to commit'):
+ print 'ERROR: Please commit to master first'
+ print 'Merge aborted.'
+
+ else:
+ print 'Copying files...'
+ if not os.path.exists('build'):
+ os.mkdir('build')
+
if __name__ == '__main__':
- create_index()
+ if len(sys.argv) > 1:
+ if sys.argv[1] == 'pages':
+ print 'Merging into pages...'
+ merge_pages()
+ elif sys.argv[1] == 'all':
+ print 'Generating index...'
+ create_index()
+
+ print 'Merging into pages...'
+ merge_pages()
+
+ else:
+ print 'Generating index...'
+ create_index()
+

0 comments on commit 4ca7bf2

Please sign in to comment.