forked from support-project/knowledge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
copy-emoji.js
36 lines (31 loc) · 1002 Bytes
/
copy-emoji.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
console.log('copy emoji')
var fs = require('fs-extra');
var copy = function (oldPath, newPath) {
return new Promise(function(resolve, reject) {
fs.copy(oldPath, newPath, function (err) {
if (err) {
return reject(err);
}
return resolve();
});
});
}
var mkdirs = function(path) {
return new Promise(function(resolve, reject) {
fs.mkdirs(path, function(err) {
if (err) {
return reject(err);
}
return resolve();
});
});
};
mkdirs('src/main/webapp/bower/emoji-parser').then(function() {
return copy('node_modules/emoji-parser/parse.js', 'src/main/webapp/bower/emoji-parser/main.min.js');
}).then(function() {
return copy('node_modules/emoji-images/pngs', 'src/main/webapp/bower/emoji-parser/emoji/');
}).then(function() {
console.log('Copied emoji-parser from node_modules to bower.')
}).catch(function(err) {
console.error(err);
});