From fe56283811d6cbc06847f2584ca3a963c87e4a79 Mon Sep 17 00:00:00 2001
From: Tankred Hase <tankred@whiteout.io>
Date: Mon, 13 Jan 2014 20:46:35 +0100
Subject: [PATCH] add grunt clean to build

---
 Gruntfile.js |  6 ++++--
 package.json | 16 ++++++++++++----
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/Gruntfile.js b/Gruntfile.js
index 6eff3230..dc0ad548 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -102,7 +102,8 @@ module.exports = function(grunt) {
         src: ['mocha/mocha.css', 'mocha/mocha.js', 'chai/chai.js'],
         dest: 'test/lib/'
       }
-    }
+    },
+    clean: ['dist/']
   });
 
   // Load the plugin(s)
@@ -114,9 +115,10 @@ module.exports = function(grunt) {
   grunt.loadNpmTasks('grunt-jsdoc');
   grunt.loadNpmTasks('grunt-mocha-test');
   grunt.loadNpmTasks('grunt-contrib-copy');
+  grunt.loadNpmTasks('grunt-contrib-clean');
 
   grunt.registerTask('default', 'Build OpenPGP.js', function() {
-    grunt.task.run(['browserify', 'replace', 'uglify', 'npm_pack']);
+    grunt.task.run(['clean', 'browserify', 'replace', 'uglify', 'npm_pack']);
     //TODO jshint is not run because of too many discovered issues, once these are addressed it should autorun
     grunt.log.ok('Before Submitting a Pull Request please also run `grunt jshint`.');
   });
diff --git a/package.json b/package.json
index bc827dfc..509c970b 100644
--- a/package.json
+++ b/package.json
@@ -1,19 +1,26 @@
 {
   "name": "openpgp",
-  "description":  "OpenPGP.js is a Javascript implementation of the OpenPGP protocol. This is defined in RFC 4880.",
+  "description": "OpenPGP.js is a Javascript implementation of the OpenPGP protocol. This is defined in RFC 4880.",
   "version": "0.2.1",
   "homepage": "http://openpgpjs.org/",
   "engines": {
     "node": ">=0.8"
   },
-  "keywords": ["crypto", "pgp", "gpg", "openpgp"],
+  "keywords": [
+    "crypto",
+    "pgp",
+    "gpg",
+    "openpgp"
+  ],
   "main": "src/index.js",
   "directories": {
     "lib": "src"
   },
   "files": [
     "src/",
-    "test/unittests.js", "test/general", "test/crypto"
+    "test/unittests.js",
+    "test/general",
+    "test/crypto"
   ],
   "scripts": {
     "pretest": "grunt",
@@ -33,7 +40,8 @@
     "grunt-jsbeautifier": "*",
     "grunt-contrib-jshint": "*",
     "grunt-jsdoc": "*",
-    "grunt-mocha-test": "~0.8.1"
+    "grunt-mocha-test": "~0.8.1",
+    "grunt-contrib-clean": "~0.5.0"
   },
   "dependencies": {
     "node-localstorage": "~0.3.4"