Skip to content

Commit 1f3f209

Browse files
committed
Should work...
1 parent 6ffaf62 commit 1f3f209

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

make

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,20 @@ def merge_pages():
9494
shutil.copytree('html/js', 'build/js')
9595
shutil.copyfile('html/index.html', 'build/index.html')
9696
print 'Files copied sucessfully'
97-
return merge_git()
97+
98+
print 'Switching to gh-pages...'
99+
git = subprocess.Popen(['git', 'checkout', 'gh-pages'],
100+
stdout=subprocess.PIPE)
101+
102+
print git.communicate()
103+
status = merge_git()
104+
105+
print 'Returning to master...'
106+
git = subprocess.Popen(['git', 'checkout', 'master'],
107+
stdout=subprocess.PIPE)
108+
109+
print git.communicate()
110+
return status
98111

99112
else:
100113
print 'ERROR: Failed to remove old build directory'
@@ -104,9 +117,16 @@ def merge_pages():
104117

105118

106119
def merge_git():
107-
git = subprocess.Popen(['git', 'checkout', 'gh-pages'], stdout=subprocess.PIPE)
108-
print git.communicate()[0].strip().split('\n')
109-
return 0
120+
if os.path.exists('build'):
121+
shutil.copytree('build/css', 'css')
122+
shutil.copytree('build/js', 'js')
123+
shutil.copyfile('build/index.html', 'index.html')
124+
shutil.rmtree('build')
125+
return 0
126+
127+
else:
128+
print 'ERROR: build directory missing'
129+
return 1
110130

111131

112132
def merge():

0 commit comments

Comments
 (0)