summaryrefslogtreecommitdiff
path: root/resources/assets/scripts/copyAssets.js
blob: 1c8e9e2470b52421dbcd0eb0d61542587ebd49a9 (plain)
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
const fs = require('fs');
const path = require('path');
const mkdirp = require('mkdirp');

const baseAssetPath = {
    src: path.resolve('resources/assets'),
    target: path.resolve('public/assets')
};

const emojiPath = {
    src: baseAssetPath.src + '/emojis',
    target: baseAssetPath.target + '/emojis'
};

mkdirp.sync(emojiPath.target);

const emojis = fs.readdirSync(emojiPath.src);

emojis.forEach((e) => {
    fs.copyFile(`${emojiPath.src}/${e}`, `${emojiPath.target}/${e}`, (e) => {
        if (e) {
            console.error(e);
        }
    });
});