forked from blackears/blenderNormalBrush
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakeDeploy.py
44 lines (34 loc) · 1.06 KB
/
makeDeploy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python
import os
import glob
import shutil
import zipfile
def zipdir(path, ziph):
# ziph is zipfile handle
for root, dirs, files in os.walk(path):
for file in files:
ziph.write(os.path.join(root, file))
def copytree(src, dst):
for item in os.listdir(src):
s = os.path.join(src, item)
d = os.path.join(dst, item)
if os.path.isdir(s):
os.mkdir(d)
copytree(s, d)
else:
filename, extn = os.path.splitext(item)
print ("file " + filename + " extn " + extn)
if (extn != ".py" and extn != ".png"):
continue
shutil.copy(s, d)
if __name__ == '__main__':
curPath = os.getcwd()
if os.path.exists('build'):
shutil.rmtree('build')
os.mkdir('build')
os.mkdir('build/normalBrush')
if os.path.exists('deploy'):
shutil.rmtree('deploy')
os.mkdir('deploy')
copytree("source", "build/normalBrush");
shutil.make_archive("deploy/normalBrush", "zip", "build")