Skip to content

Commit

Permalink
Merge pull request #51 from flyingcircusio/fix-current-symlink
Browse files Browse the repository at this point in the history
Fix current symlink feature: link to env_hash instead of env_dir
  • Loading branch information
zagy authored May 7, 2024
2 parents 227a08b + c67fc61 commit 796a855
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/appenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def prepare(self, args=None, remaining=None):
os.unlink(current_path)
except FileNotFoundError:
pass
os.symlink(env_dir, current_path)
os.symlink(env_hash, current_path)

self.env_dir = env_dir

Expand Down
3 changes: 2 additions & 1 deletion tests/test_prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ def test_prepare_creates_venv_symlink(workdir, monkeypatch):
env.update_lockfile()
env.prepare()
assert os.path.islink(os.path.join(env.appenv_dir, "current"))
assert os.readlink(os.path.join(env.appenv_dir, "current")) == env.env_dir
assert (os.path.realpath(os.path.join(
env.appenv_dir, "current")) == os.path.realpath(env.env_dir))

0 comments on commit 796a855

Please sign in to comment.