|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
import Settings from './Settings';
|
|
|
|
|
import Settings, { SETTINGS_FILE } from './Settings';
|
|
|
|
|
import Render from './Render';
|
|
|
|
|
import StringUtils from '../../src/com/utils/StringUtils';
|
|
|
|
|
import _ from 'lodash';
|
|
|
|
@ -6,6 +6,7 @@ const settings = new Settings();
|
|
|
|
|
const render = new Render();
|
|
|
|
|
const stringUtils = new StringUtils();
|
|
|
|
|
const moment = require('moment');
|
|
|
|
|
const fs = require('fs-extra');
|
|
|
|
|
|
|
|
|
|
export default class Utils {
|
|
|
|
|
constructor() {}
|
|
|
|
@ -93,4 +94,37 @@ export default class Utils {
|
|
|
|
|
}
|
|
|
|
|
render.publishArchive(archive);
|
|
|
|
|
}
|
|
|
|
|
moveAssets() {
|
|
|
|
|
settings
|
|
|
|
|
.load(SETTINGS_FILE)
|
|
|
|
|
.then(settings => {
|
|
|
|
|
//move css assets to public directory
|
|
|
|
|
fs.copy(
|
|
|
|
|
'content/themes/' + settings.global.theme + '/assets/css',
|
|
|
|
|
'public/assets/css',
|
|
|
|
|
function (err) {
|
|
|
|
|
if (err) {
|
|
|
|
|
//console.log('An error occured while copying the folder.', err);
|
|
|
|
|
//return console.error(err);
|
|
|
|
|
}
|
|
|
|
|
//console.log('Copy completed!');
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
//move js assets to public directory
|
|
|
|
|
fs.copy(
|
|
|
|
|
'content/themes/' + settings.global.theme + '/assets/scripts',
|
|
|
|
|
'public/assets/scripts',
|
|
|
|
|
function (err) {
|
|
|
|
|
if (err) {
|
|
|
|
|
//console.log('An error occured while copying the folder.', err);
|
|
|
|
|
//return console.error(err);
|
|
|
|
|
}
|
|
|
|
|
//console.log('Copy completed!');
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
//console.log('ERROR', err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|