Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support for Git-bash on Windows. #238

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion nodeenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import zipfile
import shutil
import glob
import psutil

try: # pragma: no cover (py2 only)
from ConfigParser import SafeConfigParser as ConfigParser
Expand All @@ -52,8 +53,16 @@
if is_PY3:
from functools import cmp_to_key

is_WIN = platform.system() == 'Windows'
is_CYGWIN = platform.system().startswith('CYGWIN')
if platform.system() == 'Windows':
is_WIN = True
# if a bash terminal is used in the process of activating this script, install as CYGWIN
proc_parent = psutil.Process(os.getpid()).parent()
while proc_parent is not None and proc_parent.name() != 'bash.exe':
proc_parent = proc_parent.parent()
if proc_parent is not None and proc_parent.name() == 'bash.exe':
is_WIN = False
is_CYGWIN = True


# ---------------------------------------------------------
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ def read_file(file_name):
license='BSD',
author='Eugene Kalinin',
author_email='e.v.kalinin@gmail.com',
install_requires=[],
install_requires=[
'psutil'
],
description="Node.js virtual environment builder",
long_description=ldesc,
py_modules=['nodeenv'],
Expand Down