<commit_before># Vend
[![Travis
branch](https://img.shields.io/travis/emil2k/vend.svg?style=flat)](https://travis-ci.org/emil2k/vend)
[![Coverage
Status](https://img.shields.io/coveralls/emil2k/vend.svg?style=flat)](https://coveralls.io/r/emil2k/vend)

**WARNING: This is a work in progress, if you want to help jump in.**

A Swiss Army knife for vending your own Go packages.

## Installation

```
go get github.com/emil2k/vend
```

## Compatibility

- Go 1.2+
- Should work on OSX and Linux, someone should test it on Windows.

## Usage

This tool makes a couple of assumptions about a given package :

- The dependencies are present, run `go get -u`.
- Located in the proper location in the `GOPATH`.

  If you are working on a fork, make sure the package is located in the
directory in your `GOPATH` allocated for the original package. You can add your
fork as a remote.

### `vend init`

For the package in the current working directory copies all external packages
into the specified `[directory]`, while updating all the import paths. The
specified `[directory]` is created if necessary. External packages are packages
not located in the standard library, a parent directory, or a subdirectory.

The packages are copied into a subdirectory specified by the package name. If
multiple dependencies have the same package name the command will fail and
provide all the duplicates, the user should use the `vend cp` command to place
those packages in unique directories before running `vend init` again to process
the other packages.

```
vend init [directory]

-f=false: forces copy, replaces destination folder
-i=false: include hidden files, files starting with a dot
-r=false: recurse into subdirectories to vend their imports as well
-v=false: detailed output
```

Example :

```
vend init ./lib
```

### `vend cp`

Copies the package in the `[from]` import path or directory to the `[to]`
directory, updating the necessary import paths for the package in the current
working directory.

```
vend cp [from] [to]

-f=false: forces copy, replaces destination folder
-i=false: include hidden files, files starting with a dot
-r=false: recurse into subdirectories to include their dependencies
-v=false: detailed output
```

Example :

```<commit_msg>Fix readme.<commit_after># Vend
[![Travis
branch](https://img.shields.io/travis/emil2k/vend.svg?style=flat)](https://travis-ci.org/emil2k/vend)
[![Coverage
Status](https://img.shields.io/coveralls/emil2k/vend.svg?style=flat)](https://coveralls.io/r/emil2k/vend)

**WARNING: This is a work in progress, if you want to help jump in.**

A Swiss Army knife for vending your own Go packages.

## Installation

```
go get github.com/emil2k/vend
```

## Compatibility

- Go 1.2+
- Should work on OSX and Linux, someone should test it on Windows.

## Usage

This tool makes a couple of assumptions about a given package :

- The dependencies are present, run `go get -u`.
- Located in the proper location in the `GOPATH`.

  If you are working on a fork, make sure the package is located in the
directory in your `GOPATH` allocated for the original package. You can add your
fork as a remote.

### `vend init`

For the package in the current working directory copies all external packages
into the specified `[directory]`, while updating all the import paths. The
specified `[directory]` is created if necessary. External packages are packages
not located in the standard library, a parent directory, or a subdirectory.

The packages are copied into a subdirectory specified by the package name. If
multiple dependencies have the same package name the command will fail and
provide all the duplicates, the user should use the `vend cp` command to place
those packages in unique directories before running `vend init` again to process
the other packages.

```
vend init [directory]

-f=false: forces copy, replaces destination folder
-i=false: include hidden files, files starting with a dot
-r=false: recurse into subdirectories to include their dependencies
-v=false: detailed output
```

Example :

```
vend init ./lib
```

### `vend cp`

Copies the package in the `[from]` import path or directory to the `[to]`
directory, updating the necessary import paths for the package in the current
working directory.

```
vend cp [from] [to]

-f=false: forces copy, replaces destination folder
-i=false: include hidden files, files starting with a dot
-r=false: recurse into subdirectories to update their import paths of the copied packages
-v=false: detailed output
```

Example :

```
{'fraction_non_alphanumeric': 0.08988515901060071, 'fraction_numerical': 0.0030918727915194345, 'mean_word_length': 4.483050847457627, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, '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': '585187', 'n_tokens_mistral': 1342, 'n_tokens_neox': 1291, 'n_words': 614}