Add 'unsymlink command to remove the symlink

This commit is contained in:
Thomas Kluyver 2013-12-16 15:12:39 -08:00
parent 37edc78d76
commit 74cb75e0c9
2 changed files with 11 additions and 0 deletions

View File

@ -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,
}

View File

@ -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':