-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexport.py
34 lines (27 loc) · 876 Bytes
/
export.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
from distutils.dir_util import copy_tree
import os
x = dict()
# x.
def ExportGo(Gopath="/Users/minhtuannguyen/go/src/", excludes=[]):
# Get current dir
fromDirectory = os.getcwd()
# get current dir name
foldername = os.path.basename(fromDirectory)
# copy subdirectory example
# combine current dir with go-path
toDirectory = str(Gopath)+foldername
# Get all subdir abs path
from glob import glob
listdir = glob("./*/")
# print(listdir)
for folder in listdir:
if folder not in excludes:
copy_tree(fromDirectory + folder[1:-1], toDirectory+folder[1:-1])
print("export: ", folder)
# d = '.'
# listFolder = [os.path.join(d, o) for o in os.listdir(d) if os.path.isdir(os.path.join(d, o))]
# print(listFolder)
def main():
ExportGo(excludes=['./test2/'])
if __name__ == '__main__':
main()