Install node.js packages via npm
(env_dir, args)
| 876 | |
| 877 | |
| 878 | def install_packages(env_dir, args): |
| 879 | """ |
| 880 | Install node.js packages via npm |
| 881 | """ |
| 882 | logger.info(' * Install node.js packages ... ', |
| 883 | extra=dict(continued=True)) |
| 884 | packages = [package.strip() for package in |
| 885 | open(args.requirements).readlines()] |
| 886 | activate_path = join(env_dir, 'bin', 'activate') |
| 887 | real_npm_ver = args.npm if args.npm.count(".") == 2 else args.npm + ".0" |
| 888 | if args.npm == "latest" or real_npm_ver >= "1.0.0": |
| 889 | cmd = '. ' + _quote(activate_path) + \ |
| 890 | ' && npm install -g %(pack)s' |
| 891 | else: |
| 892 | cmd = '. ' + _quote(activate_path) + \ |
| 893 | ' && npm install %(pack)s' + \ |
| 894 | ' && npm activate %(pack)s' |
| 895 | |
| 896 | for package in packages: |
| 897 | if not package: |
| 898 | continue |
| 899 | callit(cmd=[ |
| 900 | cmd % {"pack": package}], show_stdout=args.verbose, in_shell=True) |
| 901 | |
| 902 | logger.info('done.') |
| 903 | |
| 904 | |
| 905 | def install_activate(env_dir, args): |
no test coverage detected