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

Function main

nodeenv.py:1098–1148  ·  view source on GitHub ↗

Entry point

()

Source from the content-addressed store, hash-verified

1096
1097# noinspection PyProtectedMember
1098def main():
1099 """
1100 Entry point
1101 """
1102 # quick&dirty way to help update the README
1103 if "--dump-config-defaults" in sys.argv:
1104 Config._dump()
1105 return
1106
1107 args = parse_args(check=False)
1108 # noinspection PyProtectedMember
1109 Config._load(args.config_file, args.verbose)
1110
1111 args = parse_args()
1112
1113 if args.node.lower() == 'system' and is_WIN:
1114 logger.error('Installing system node.js on win32 is not supported!')
1115 exit(1)
1116
1117 global src_base_url
1118 global ignore_ssl_certs
1119
1120 ignore_ssl_certs = args.ignore_ssl_certs
1121
1122 src_domain = None
1123 if args.mirror:
1124 if '://' in args.mirror:
1125 src_base_url = args.mirror
1126 else:
1127 src_domain = args.mirror
1128 # use unofficial builds only if musl and no explicitly chosen mirror
1129 elif is_x86_64_musl() or is_riscv64():
1130 src_domain = 'unofficial-builds.nodejs.org'
1131 else:
1132 src_domain = 'nodejs.org'
1133 if src_base_url is None:
1134 src_base_url = 'https://%s/download/release' % src_domain
1135
1136 if not args.node or args.node.lower() == 'latest':
1137 args.node = get_last_stable_node_version()
1138 elif args.node.lower() == 'lts':
1139 args.node = get_last_lts_node_version()
1140
1141 if args.list:
1142 print_node_versions()
1143 elif args.update:
1144 env_dir = get_env_dir(args)
1145 install_packages(env_dir, args)
1146 else:
1147 env_dir = get_env_dir(args)
1148 create_environment(env_dir, args)
1149
1150
1151# ---------------------------------------------------------

Callers 1

nodeenv.pyFile · 0.85

Calls 11

parse_argsFunction · 0.85
is_x86_64_muslFunction · 0.85
is_riscv64Function · 0.85
print_node_versionsFunction · 0.85
get_env_dirFunction · 0.85
install_packagesFunction · 0.85
create_environmentFunction · 0.85
_dumpMethod · 0.80
_loadMethod · 0.80

Tested by

no test coverage detected