forked from jupyterlab/jupyterlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
clean.py
23 lines (17 loc) · 668 Bytes
/
clean.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os
import subprocess
here = os.path.abspath(os.path.dirname(__file__))
# Workaround for https://github.com/git-for-windows/git/issues/607
if os.name == 'nt':
for (root, dnames, files) in os.walk(here):
if 'node_modules' in dnames:
subprocess.check_call(['rmdir', '/s', '/q', 'node_modules'],
cwd=root, shell=True)
dnames.remove('node_modules')
git_clean_exclude = [
'-e',
'/.vscode',
]
git_clean_command = ['git', 'clean', '-dfx'] + git_clean_exclude
subprocess.check_call(git_clean_command, cwd=here)
subprocess.call('python -m pip uninstall -y jupyterlab'.split(), cwd=here)