def gem(args): if args[0] == 'install': args[1:1] = [ '--no-user-install', '--install-dir', GEM_HOME, '--no-ri', '--no-rdoc', ] sh([which.gem] + args) which.update()
def pip(args): """Run a pip command""" if not args: args = ["freeze"] elif args[0] == "freeze" and len(args) > 1: out = sh([which.pip, "freeze"], capture=True) keys = tuple(l.lower() for l in args[1:]) for line in out.split(): if line.lower().startswith(keys): sys.stdout.write(line) sys.stdout.write("\n") return elif args[0] == "install": if defaults.PYPI_PACKAGE_INDEX: extra = ["--index-url", defaults.PYPI_PACKAGE_INDEX] if defaults.PYPI_PACKAGE_INDEX_IGNORE_SSL: url = urlparse(defaults.PYPI_PACKAGE_INDEX) extra.extend(["--trusted-host", url.netloc]) args[1:1] = extra sh([which.pip] + args) which.update()
def npm(args): sh([which.npm] + args) which.update()