Skip to content
This repository has been archived by the owner on Oct 3, 2018. It is now read-only.

Commit

Permalink
Added gulp update task
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-lynch committed Nov 11, 2014
1 parent dc529a5 commit 7b995e3
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Expand Up @@ -4,7 +4,7 @@
root = true

[*]
charset = "utf8"
charset = "utf-8"
end_of_line = lf
insert_final_newline = true

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -34,6 +34,6 @@ git log --pretty=format:"- %s" >> log.md

If you have rights to publish to npm, do the following first:

- Run `update.sh`. This will update the project with the latest emoji from [emoji-cheat-sheet.com](http://www.emoji-cheat-sheet.com).
- Run `gulp update`. This will update the project with the latest emoji from [emoji-cheat-sheet.com](http://www.emoji-cheat-sheet.com).
- Run `gulp`
- Run `npm publish`
8 changes: 3 additions & 5 deletions emojify.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion emojify.min.js

Large diffs are not rendered by default.

28 changes: 26 additions & 2 deletions gulpfile.js
@@ -1,6 +1,8 @@
var gulp = require('gulp'),
$ = require('gulp-load-plugins')(),
path = require('path');
path = require('path'),
minimatch = require('minimatch'),
through2 = require('through2');

gulp.task('default', ['compile']);

Expand Down Expand Up @@ -70,4 +72,26 @@ gulp.task('test-node', function(){
.pipe($.mocha({
reporter: 'spec'
}));
});
});

gulp.task('update', function(done){
var emoji = '';

$.download('https://github.com/arvida/emoji-cheat-sheet.com/archive/master.zip')
.pipe($.unzip())
.pipe($.filter(function(file){
return minimatch(file.path, '**/public/graphics/emojis/*.png');
}))
.pipe($.rename({ dirname: './' }))
.pipe(gulp.dest('./images/emoji'))
.pipe(through2({ objectMode: true }, function(file, enc, cb){
emoji += ',' + path.basename(file.path, path.extname(file.path));
this.push(file);
cb();
}, function(){
gulp.src('./emojify.js')
.pipe($.replace(/(\/\*##EMOJILIST\*\/).+$/m, '$1"' + emoji.substr(1) + '";'))
.pipe(gulp.dest('./'))
.on('end', done);
}));
});
7 changes: 6 additions & 1 deletion package.json
Expand Up @@ -35,7 +35,12 @@
"gulp-minify-css": "~0.3.11",
"gulp-image-data-uri": "~0.1.0",
"gulp-filter": "~1.0.2",
"gulp-concat": "~2.4.1"
"gulp-concat": "~2.4.1",
"gulp-download": "0.0.1",
"gulp-unzip": "~0.1.2",
"minimatch": "~1.0.0",
"through2": "~0.6.3",
"gulp-replace": "~0.5.0"
},
"testling": {
"html": "tests/browser/browser.html",
Expand Down
45 changes: 0 additions & 45 deletions update.sh

This file was deleted.

0 comments on commit 7b995e3

Please sign in to comment.