<commit_before>package main

import (
	"bufio"
	"bytes"
	"io"
	"os"
	"path/filepath"
	"regexp"
	"strings"

	"github.com/gophergala/nut/vendor/_nuts/github.com/codegangsta/cli"
)

var installCmd = cli.Command{
	Name:   "install",
	Usage:  "install this project's dependencies",
	Action: runInstall,
}

func runInstall(c *cli.Context) {
	config := setting.Config()
	pl := &PkgLoader{
		Deps: config.Deps,
	}
	pkgs, err := pl.Load()
	check(err)

	l := pkgLister{
		Env: os.Environ(),
	}
	currentPkg, err := l.List(".")
	check(err)

	err = rewrite(pkgs, currentPkg[0].ImportPath)
	check(err)

	err = os.RemoveAll(setting.VendorDir())
	check(err)

	err = copyPkgs(pkgs)
	check(err)
}

func copyPkgs(pkgs []*Pkg) error {<commit_msg>Return if there’s no dependencies to install<commit_after>package main

import (
	"bufio"
	"bytes"
	"io"
	"os"
	"path/filepath"
	"regexp"
	"strings"

	"github.com/gophergala/nut/vendor/_nuts/github.com/codegangsta/cli"
)

var installCmd = cli.Command{
	Name:   "install",
	Usage:  "install this project's dependencies",
	Action: runInstall,
}

func runInstall(c *cli.Context) {
	config := setting.Config()
	if len(config.Deps) == 0 {
		return
	}

	pl := &PkgLoader{
		Deps: config.Deps,
	}
	pkgs, err := pl.Load()
	check(err)

	l := pkgLister{
		Env: os.Environ(),
	}
	currentPkg, err := l.List(".")
	check(err)

	err = rewrite(pkgs, currentPkg[0].ImportPath)
	check(err)

	err = os.RemoveAll(setting.VendorDir())
	check(err)

	err = copyPkgs(pkgs)
	check(err)
}

func copyPkgs(pkgs []*Pkg) error {
{'fraction_non_alphanumeric': 0.16535433070866143, 'fraction_numerical': 0.001968503937007874, 'mean_word_length': 4.187074829931973, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3539354', 'n_tokens_mistral': 663, 'n_tokens_neox': 637, 'n_words': 126}