Skip to content

Commit

Permalink
Start work on the auto merging
Browse files Browse the repository at this point in the history
  • Loading branch information
BonsaiDen committed Feb 13, 2011
1 parent 7c1b9bc commit 4ca7bf2
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion make
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import markdown
import shutil
import os
import sys
import subprocess

def create_index():
articles = []
Expand Down Expand Up @@ -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.