File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 1515import shutil
1616import sys
1717
18-
18+ # 要保留的文件/文件夹列表
19+ keep_files = {'highlight_test_lexer.py' , 'conf.py' , 'make.bat' , 'Makefile' }
20+
21+ # 遍历当前目录
22+ for item in os .listdir ('.' ):
23+ if item not in keep_files :
24+ path = os .path .join ('.' , item )
25+ try :
26+ if os .path .isfile (path ):
27+ os .remove (path )
28+ elif os .path .isdir (path ):
29+ shutil .rmtree (path )
30+ except Exception as e :
31+ print (f"Error deleting { item } : { e } " )
1932
2033build_version = os .environ .get ('CURRENT_VERSION' , 'v3' )
2134if build_version == 'v2' :
2841 shutil .copytree (
2942 os .path .join (os .path .dirname (__file__ ), '../docs_version3' ),
3043 os .path .join (os .path .dirname (__file__ ), ),
44+ dirs_exist_ok = True
3145 )
3246
3347sys .path .insert (0 , os .path .abspath ('./' ))
4761author = 'BrainPy Team'
4862
4963from highlight_test_lexer import fix_ipython2_lexer_in_notebooks
64+
5065fix_ipython2_lexer_in_notebooks (os .path .dirname (os .path .abspath (__file__ )))
5166
5267# The full version, including alpha/beta/rc tags
You can’t perform that action at this time.
0 commit comments