MCPcopy Index your code
hub / github.com/ekalinin/nodeenv / install_node_wrapped

Function install_node_wrapped

nodeenv.py:770–802  ·  view source on GitHub ↗
(env_dir, src_dir, args)

Source from the content-addressed store, hash-verified

768
769
770def install_node_wrapped(env_dir, src_dir, args):
771 env_dir = abspath(env_dir)
772 node_src_dir = join(src_dir, to_utf8('node-v%s' % args.node))
773 src_type = "prebuilt" if args.prebuilt else "source"
774
775 logger.info(' * Install %s node (%s) ' % (src_type, args.node),
776 extra=dict(continued=True))
777
778 if args.prebuilt:
779 node_url = get_node_bin_url(args.node)
780 else:
781 node_url = get_node_src_url(args.node)
782
783 # get src if not downloaded yet
784 if not os.path.exists(node_src_dir):
785 try:
786 download_node_src(node_url, src_dir, args)
787 except urllib2.HTTPError:
788 if "arm64" in node_url:
789 # if arm64 not found, try x64
790 download_node_src(node_url.replace('arm64', 'x64'),
791 src_dir, args)
792 else:
793 logger.warning('Failed to download from %s' % node_url)
794
795 logger.info('.', extra=dict(continued=True))
796
797 if args.prebuilt:
798 copy_node_from_prebuilt(env_dir, src_dir, args.node)
799 else:
800 build_node_from_src(env_dir, src_dir, node_src_dir, args)
801
802 logger.info(' done.')
803
804
805def install_npm(env_dir, _src_dir, args):

Callers 1

install_nodeFunction · 0.85

Calls 6

to_utf8Function · 0.85
get_node_bin_urlFunction · 0.85
get_node_src_urlFunction · 0.85
download_node_srcFunction · 0.85
copy_node_from_prebuiltFunction · 0.85
build_node_from_srcFunction · 0.85

Tested by

no test coverage detected