Skip to content

Commit cbb29c9

Browse files
author
Chongkai Zhu
committed
add symlink support
1 parent b1f6dbd commit cbb29c9

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
testing/environments*/*
22
build
33
dist
4-
venv_pack.egg-info
4+
venv_pack2.egg-info
55
.cache
66
.coverage
7-
htmlcov/
87
.pytest_cache/
98
*.pyc

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from setuptools import setup
22

33
setup(name='venv-pack2',
4-
version='0.5.0',
4+
version='0.6.0',
55
url='https://github.com/mrmathematica/venv-pack',
66
project_urls={"Source Code": "https://github.com/mrmathematica/venv-pack"},
77
maintainer='mrmathematica',

venv_pack/core.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,10 @@ def _rewrite_shebang(data, target, prefix):
600600

601601
if executable.startswith(prefix_b):
602602
# shebang points inside environment, rewrite
603-
executable_name = os.path.basename(executable)
604-
new_shebang = (b'#!%s' if on_win else b'#!/bin/sh\n"exec" "`dirname $0`/%s" "$0" "$@"\n') % executable_name
603+
new_shebang = (b'#!%s'
604+
if on_win else
605+
b'#!/bin/sh\n"exec" "`dirname $(realpath $0)`/%s" "$0" "$@"\n')\
606+
% os.path.basename(executable)
605607
data = data.replace(shebang, new_shebang)
606608

607609
return data, True, target

0 commit comments

Comments
 (0)