Moved scripts/copyAssets.js to resources folder and fixed formatting
This commit is contained in:
parent
fc9fb14498
commit
13d2786b7b
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "engelsystem",
|
||||
"version": "1.0.0",
|
||||
"version": "1.1.0",
|
||||
"main": "index.js",
|
||||
"repository": "https://github.com/engelsystem/engelsystem.git",
|
||||
"author": "marudor <marudor@marudor.de>",
|
||||
|
@ -8,7 +8,7 @@
|
|||
"scripts": {
|
||||
"build": "npm run -s build:clean && NODE_ENV=production run-p build:assets build:webpack",
|
||||
"build:clean": "rimraf public/assets",
|
||||
"build:assets": "node scripts/copyAssets.js",
|
||||
"build:assets": "node resources/assets/scripts/copyAssets.js",
|
||||
"build:webpack": "webpack",
|
||||
"build:watch": "webpack --watch"
|
||||
},
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
});
|
|
@ -1,25 +0,0 @@
|
|||
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);
|
||||
}
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue