1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-05 14:58:48 +00:00

fix pivot strip home

This commit is contained in:
deadc0de6
2018-12-27 15:51:31 +01:00
parent cf96584f7b
commit b8786a3fa8

View File

@@ -252,10 +252,16 @@ class Installer:
def _pivot_path(self, path, newdir, striphome=False):
"""change path to be under newdir"""
if self.debug:
self.log.dbg('pivot new dir: \"{}\"'.format(newdir))
self.log.dbg('strip home: {}'.format(striphome))
if striphome:
utils.strip_home(path)
path = utils.strip_home(path)
sub = path.lstrip(os.sep)
return os.path.join(newdir, sub)
new = os.path.join(newdir, sub)
if self.debug:
self.log.dbg('pivot \"{}\" to \"{}\"'.format(path, new))
return new
def _exec_pre_actions(self, actions):
"""execute pre-actions if any"""