Skip to content
Merged
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
13 changes: 7 additions & 6 deletions nodeenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import logging
import optparse
import subprocess
import pipes

try:
import ConfigParser
Expand Down Expand Up @@ -296,7 +297,7 @@ def download_node(node_url, src_dir, env_dir, opt):
cmd.append('xzf')
cmd.append('-')
cmd.append('-C')
cmd.append(src_dir)
cmd.append(pipes.quote(src_dir))
try:
callit(cmd, opt.verbose, True, env_dir)
logger.info(') ', extra=dict(continued=True))
Expand Down Expand Up @@ -342,7 +343,7 @@ def install_node(env_dir, src_dir, opt):

conf_cmd = []
conf_cmd.append('./configure')
conf_cmd.append('--prefix=%s' % (env_dir))
conf_cmd.append('--prefix=%s' % pipes.quote(env_dir))
if opt.without_ssl:
conf_cmd.append('--without-ssl')
if opt.debug:
Expand All @@ -367,7 +368,7 @@ def install_npm(env_dir, src_dir, opt):
logger.info(' * Install npm.js (%s) ... ' % opt.npm,
extra=dict(continued=True))
cmd = ['. %s && curl --silent %s | clean=%s npm_install=%s bash && deactivate_node' % (
join(env_dir, 'bin', 'activate'),
pipes.quote(join(env_dir, 'bin', 'activate')),
'https://npmjs.org/install.sh',
'no' if opt.no_npm_clean else 'yes',
opt.npm)]
Expand All @@ -386,10 +387,10 @@ def install_packages(env_dir, opt):
activate_path = join(env_dir, 'bin', 'activate')
real_npm_ver = opt.npm if opt.npm.count(".") == 2 else opt.npm + ".0"
if opt.npm == "latest" or real_npm_ver >= "1.0.0":
cmd = '. ' + activate_path + \
cmd = '. ' + pipes.quote(activate_path) + \
' && npm install -g %(pack)s'
else:
cmd = '. ' + activate_path + \
cmd = '. ' + pipes.quote(activate_path) + \
' && npm install %(pack)s' + \
' && npm activate %(pack)s'

Expand Down Expand Up @@ -443,7 +444,7 @@ def create_environment(env_dir, opt):
install_packages(env_dir, opt)
# Cleanup
if opt.clean_src:
callit(['rm -rf', src_dir], opt.verbose, True, env_dir)
callit(['rm -rf', pipes.quote(src_dir)], opt.verbose, True, env_dir)


def print_node_versions():
Expand Down