<commit_before># grunt-dropbox

> Grunt plugin for uploading build artifacts to dropbox

## Getting Started
This plugin requires Grunt `~0.4.5`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
npm install grunt-dropbox --save-dev
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-dropbox');
```

## The "dropbox" task

### Files
When specifying files, the destination must be specified (i.e. specifying the source file only is not supported). The destination is the path from the root of your dropbox directory to upload the local files to.

### Options

#### options.version_name
Type: `String`
Required: `False`

An optional string value that is appended to the destination path to differentiate artifacts from different builds. If using Travis CI, it is recommended that this be set to `process.env.TRAVIS_BUILD_NUMBER`.

#### options.access_token
Type: `String`
Required: `True`

A string value that is used to authenticate with Dropbox. Note that as this task is meant to be unattended, it is assummed that an access token has already been obtained. See the wiki for more details.

### Usage Examples

Define a `dev` task that will upload the `dist` directory to `uploads/sample-project/` in the dropbox account associated with the provided token:
```js
grunt.initConfig({
  dropbox: {
    options: {
      access_token: '<token>'
    },
    dev: {
      files: {
        'uploads/sample-project': ['dist/**/*.*'],
      }
    }
  },
});
```

Define a `dev` task that will upload the files in the root of the `dist` directory to a folder under `uploads/sample-project/` named after the current travis build number (i.e. for build number 32, the files will be uploaded to `uploads/sample-project/32/`). The files are uploaded to the dropbox account associated with the access token provided via the dropbox\_access\_token environment variable:
```js
grunt.initConfig({
  dropbox: {
    options: {
      access_token: process.env.dropbox_access_token,
      version_name: process.env.TRAVIS_BUILD_NUMBER
    },
    dev: {
      files: {
        'uploads/sample-project': ['dist/*.*'],
      }<commit_msg>Added link to wiki page for access token<commit_after># grunt-dropbox

> Grunt plugin for uploading build artifacts to dropbox

## Getting Started
This plugin requires Grunt `~0.4.5`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
npm install grunt-dropbox --save-dev
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-dropbox');
```

## The "dropbox" task

### Files
When specifying files, the destination must be specified (i.e. specifying the source file only is not supported). The destination is the path from the root of your dropbox directory to upload the local files to.

### Options

#### options.version_name
Type: `String`
Required: `False`

An optional string value that is appended to the destination path to differentiate artifacts from different builds. If using Travis CI, it is recommended that this be set to `process.env.TRAVIS_BUILD_NUMBER`.

#### options.access_token
Type: `String`
Required: `True`

A string value that is used to authenticate with Dropbox. Note that as this task is meant to be unattended, it is assummed that an access token has already been obtained. See [this wiki page](https://github.com/kbremner/grunt-dropbox/wiki/Creating-a-Dropbox-Access-Token) for more details.

### Usage Examples

Define a `dev` task that will upload the `dist` directory to `uploads/sample-project/` in the dropbox account associated with the provided token:
```js
grunt.initConfig({
  dropbox: {
    options: {
      access_token: '<token>'
    },
    dev: {
      files: {
        'uploads/sample-project': ['dist/**/*.*'],
      }
    }
  },
});
```

Define a `dev` task that will upload the files in the root of the `dist` directory to a folder under `uploads/sample-project/` named after the current travis build number (i.e. for build number 32, the files will be uploaded to `uploads/sample-project/32/`). The files are uploaded to the dropbox account associated with the access token provided via the dropbox\_access\_token environment variable:
```js
grunt.initConfig({
  dropbox: {
    options: {
      access_token: process.env.dropbox_access_token,
      version_name: process.env.TRAVIS_BUILD_NUMBER
    },
    dev: {
      files: {
        'uploads/sample-project': ['dist/*.*'],
      }
{'fraction_non_alphanumeric': 0.09931972789115646, 'fraction_numerical': 0.0027210884353741495, 'mean_word_length': 3.9623915139826424, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 1, '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': '1283651', 'n_tokens_mistral': 1508, 'n_tokens_neox': 1428, 'n_words': 624}