From 991a9cef316d313b660811804692f305da9bb346 Mon Sep 17 00:00:00 2001 From: Cyrus Harrison Date: Wed, 23 Aug 2023 13:20:22 -0700 Subject: [PATCH] use proper path to create host-config symlink (#119) * use proper path to create symlink * Update uberenv.py Co-authored-by: Alex Tyler Chapman <100869159+chapman39@users.noreply.github.com> --------- Co-authored-by: Alex Tyler Chapman <100869159+chapman39@users.noreply.github.com> --- uberenv.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/uberenv.py b/uberenv.py index 9b0f40b..03578d5 100755 --- a/uberenv.py +++ b/uberenv.py @@ -1065,12 +1065,13 @@ def install(self): if len(hc_glob) > 0: hc_path = hc_glob[0] hc_fname = os.path.split(hc_path)[1] - if os.path.islink(hc_fname): - os.unlink(hc_fname) - elif os.path.isfile(hc_fname): - sexe("rm -f {0}".format(hc_fname)) - print("[symlinking host config file to {0}]".format(pjoin(self.dest_dir,hc_fname))) - os.symlink(hc_path,hc_fname) + hc_symlink_path = pjoin(self.dest_dir,hc_fname) + if os.path.islink(hc_symlink_path): + os.unlink(hc_symlink_path) + elif os.path.isfile(hc_symlink_path): + sexe("rm -f {0}".format(hc_symlink_path)) + print("[symlinking host config file {0} to {1}]".format(hc_path,hc_symlink_path)) + os.symlink(hc_path,hc_symlink_path) # if user opt'd for an install, we want to symlink the final # install to an easy place: # Symlink install directory