0.1.0 • Published 10 years ago

grunt-archive-diff v0.1.0

Weekly downloads
2
License
-
Repository
github
Last release
10 years ago

grunt-archive-diff

A Grunt plugin to export a git diff archive.
Differences are calculated between the last two tags.

Getting Started

This plugin requires Grunt ~0.4.5

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-archive-diff --save-dev

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

grunt.loadNpmTasks('grunt-archive-diff');

The "archive_diff" task

Overview

In your project's Gruntfile, add a section named archive_diff to the data object passed into grunt.initConfig().

grunt.initConfig({
  archive_diff: {
    options: {
      // Task-specific options go here.
    }
  }
});

Options

options.diffFilter

Type: String Default value: 'ACMRTUXB'

Select only files that are Added (A), Copied (C), Deleted (D), Modified (M), Renamed (R), have their type (i.e. regular file, symlink, submodule, …) changed (T), are Unmerged (U), are Unknown (X), or have had their pairing Broken (B).

$ git diff --diff-filter

options.outputDir

Type: String Default value: '.'

Archive export destination directory.

options.prefix

Type: String Default value: ''

Archive filename prefix.
(Notice: The tag name will be used an suffix.)

options.format

Type: String Default value: 'zip'

Format of the resulting archive: tar or zip.

$ git archive --format

Usage Examples

Default Options

grunt.initConfig({
    archive : {
        options: {
            diffFilter : 'ACMRTUXB',
            outputDir : '.',
            prefix : 'update',
            format : 'zip'
        }
    }
});

Custom Options

grunt.initConfig({
    archive : {
        options: {
            diffFilter : 'A',
            outputDir : './new',
            prefix : 'new-in-',
            format : 'tar.gz'
        }
    }
});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

(Nothing yet)