<commit_before>package main

import (
	"golang.org/x/crypto/ssh/terminal"

	"bufio"
	"fmt"
	"io/ioutil"
	"os"
	"strconv"
	"strings"

	"github.com/cafebazaar/kupak/logging"
	"github.com/cafebazaar/kupak/pkg/pak"
	"github.com/cafebazaar/kupak/pkg/util"
	"github.com/codegangsta/cli"
	"gopkg.in/yaml.v2"
)

func install(c *cli.Context) {
	pakURL := c.Args().First()
	valuesFile := c.Args().Get(1)
	if pakURL == "" {
		logging.Error("Please specify the pak")
		os.Exit(-1)
	}

	if strings.Index(pakURL, "/") == -1 &&
		!strings.HasSuffix(pakURL, ".json") &&
		!strings.HasSuffix(pakURL, ".yaml") {
		// it's a pak name
		// will install from repo

		nameOfPakToInstall := pakURL
		repoAddr := c.GlobalString("repo")
		if len(repoAddr) > 0 {
			// TODO: change JoinURL
			repoPaks, _ := pak.RepoFromURL(repoAddr)<commit_msg>Added verbose output to installing a pack by name<commit_after>package main

import (
	"golang.org/x/crypto/ssh/terminal"

	"bufio"
	"fmt"
	"io/ioutil"
	"os"
	"strconv"
	"strings"

	"github.com/cafebazaar/kupak/logging"
	"github.com/cafebazaar/kupak/pkg/pak"
	"github.com/cafebazaar/kupak/pkg/util"
	"github.com/codegangsta/cli"
	"gopkg.in/yaml.v2"
)

func install(c *cli.Context) {
	pakURL := c.Args().First()
	valuesFile := c.Args().Get(1)
	if pakURL == "" {
		logging.Error("Please specify the pak")
		os.Exit(-1)
	}

	if strings.Index(pakURL, "/") == -1 &&
		!strings.HasSuffix(pakURL, ".json") &&
		!strings.HasSuffix(pakURL, ".yaml") {

		nameOfPakToInstall := pakURL
		repoAddr := c.GlobalString("repo")

		// it's a pak name
		// will install from repo
		if logging.Verbose {
			logging.Log("Looking for " + nameOfPakToInstall + " in " + repoAddr)
		}

		if len(repoAddr) > 0 {
			// TODO: change JoinURL
			repoPaks, _ := pak.RepoFromURL(repoAddr)
{'fraction_non_alphanumeric': 0.1752112676056338, 'fraction_numerical': 0.005633802816901409, 'mean_word_length': 3.637075718015666, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3996123', 'n_tokens_mistral': 806, 'n_tokens_neox': 742, 'n_words': 126}