Skip to content

Commit

Permalink
Fixed infinite loop when system-wide node used. fixed #67
Browse files Browse the repository at this point in the history
  • Loading branch information
ekalinin committed May 15, 2014
1 parent 67111fd commit 9275838
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Nodeenv changelog
=================

Version 0.9.2
-------------
- Fixed infinite loop when system-wide node used. See `# 67`_

.. _# 67: https://github.com/ekalinin/nodeenv/issues/67

Version 0.9.1
-------------
- Fixed 'shim' script if used system-wide node
Expand Down
10 changes: 7 additions & 3 deletions nodeenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
:license: BSD, see LICENSE for more details.
"""

nodeenv_version = '0.9.1'
nodeenv_version = '0.9.2'

import sys
import os
Expand Down Expand Up @@ -521,7 +521,11 @@ def install_activate(env_dir, opt):
prompt = opt.prompt or '(%s)' % os.path.basename(os.path.abspath(env_dir))
mode_0755 = (stat.S_IRWXU | stat.S_IXGRP |
stat.S_IRGRP | stat.S_IROTH | stat.S_IXOTH)
shim_node = "`which node`" if opt.node == "system" else join(bin_dir, "node")

shim_node = join(bin_dir, "node")
if opt.node == "system":
_, which_node_output = callit(['which', 'node'])
shim_node = which_node_output[0]

for name, content in files.items():
file_path = join(bin_dir, name)
Expand Down Expand Up @@ -574,7 +578,7 @@ def print_node_versions():
"egrep -o '[0-9]+\.[0-9]+\.[0-9]+' | "
"sort -u -k 1,1n -k 2,2n -k 3,3n -t . ",
shell=True, stdout=subprocess.PIPE)
#out, err = p.communicate()
# out, err = p.communicate()
pos = 0
rowx = []
while 1:
Expand Down

0 comments on commit 9275838

Please sign in to comment.