mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
Add 'unsymlink command to remove the symlink
This commit is contained in:
parent
37edc78d76
commit
74cb75e0c9
2
setup.py
2
setup.py
@ -72,6 +72,7 @@ from setupbase import (
|
||||
install_symlinked,
|
||||
install_lib_symlink,
|
||||
install_scripts_for_symlink,
|
||||
unsymlink,
|
||||
)
|
||||
from setupext import setupext
|
||||
|
||||
@ -237,6 +238,7 @@ setup_args['cmdclass'] = {
|
||||
'symlink': install_symlinked,
|
||||
'install_lib_symlink': install_lib_symlink,
|
||||
'install_scripts_sym': install_scripts_for_symlink,
|
||||
'unsymlink': unsymlink,
|
||||
'jsversion' : JavascriptVersion,
|
||||
}
|
||||
|
||||
|
@ -383,6 +383,15 @@ class install_lib_symlink(Command):
|
||||
print('symlinking %s -> %s' % (pkg, dest))
|
||||
os.symlink(pkg, dest)
|
||||
|
||||
class unsymlink(install):
|
||||
def run(self):
|
||||
dest = os.path.join(self.install_lib, 'IPython')
|
||||
if os.path.islink(dest):
|
||||
print('removing symlink at %s' % dest)
|
||||
os.unlink(dest)
|
||||
else:
|
||||
print('No symlink exists at %s' % dest)
|
||||
|
||||
class install_symlinked(install):
|
||||
def run(self):
|
||||
if sys.platform == 'win32':
|
||||
|
Loading…
Reference in New Issue
Block a user