From fc9fb14498cf466083ba84c9d769dfd4cf296a83 Mon Sep 17 00:00:00 2001 From: marudor Date: Mon, 10 Sep 2018 19:53:19 +0200 Subject: Asset step & script --- scripts/copyAssets.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 scripts/copyAssets.js (limited to 'scripts') diff --git a/scripts/copyAssets.js b/scripts/copyAssets.js new file mode 100644 index 00000000..3c425baa --- /dev/null +++ b/scripts/copyAssets.js @@ -0,0 +1,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); + } + }); +}); -- cgit v1.2.3-54-g00ecf