summaryrefslogtreecommitdiff
path: root/scripts/copyAssets.js
blob: 3c425baa512e82bd65ad87ec6424f9c11875ef84 (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);
    }
  });
});