Merge pull request #71 from lektor/feature/install-nix
Adding improvements from windows install on unix install (https://github.com/lektor/lektor-website/pull/70)
This commit is contained in:
commit
702e262934
|
@ -74,17 +74,26 @@ if 1:
|
||||||
print 'Aborted!'
|
print 'Aborted!'
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
def deletion_error(func, path, excinfo):
|
||||||
|
print 'Problem deleting {}'.format(path)
|
||||||
|
print 'Please try and delete {} manually'.format(path)
|
||||||
|
print 'Aborted!'
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
def wipe_installation(lib_dir, symlink_path):
|
def wipe_installation(lib_dir, symlink_path):
|
||||||
if os.path.lexists(symlink_path):
|
if os.path.lexists(symlink_path):
|
||||||
os.remove(symlink_path)
|
os.remove(symlink_path)
|
||||||
if os.path.exists(lib_dir):
|
if os.path.exists(lib_dir):
|
||||||
shutil.rmtree(lib_dir, ignore_errors=True)
|
shutil.rmtree(lib_dir, onerror=deletion_error)
|
||||||
|
|
||||||
def check_installation(lib_dir, bin_dir):
|
def check_installation(lib_dir, bin_dir):
|
||||||
symlink_path = os.path.join(bin_dir, 'lektor')
|
symlink_path = os.path.join(bin_dir, 'lektor')
|
||||||
if os.path.exists(lib_dir) or os.path.lexists(symlink_path):
|
if os.path.exists(lib_dir) or os.path.lexists(symlink_path):
|
||||||
print ' Lektor seems to be installed already.'
|
print ' Lektor seems to be installed already.'
|
||||||
print ' Continuing will wipe %s and remove %s' % (lib_dir, symlink_path)
|
print ' Continuing will delete:'
|
||||||
|
print ' %s' % lib_dir
|
||||||
|
print ' and remove this symlink:'
|
||||||
|
print ' %s' % symlink_path
|
||||||
print
|
print
|
||||||
get_confirmation()
|
get_confirmation()
|
||||||
print
|
print
|
||||||
|
|
Loading…
Reference in New Issue