chore: Creates automatically the theme directory while building
This commit is contained in:
parent
5764a674fd
commit
704b6231f5
3 changed files with 16 additions and 0 deletions
|
@ -10,6 +10,7 @@ import { CHARSET } from "../../extensions/consts/files";
|
||||||
import { IGenericObject } from "../../extensions/interfaces/igeneric-object";
|
import { IGenericObject } from "../../extensions/interfaces/igeneric-object";
|
||||||
import { IIcon } from './../interfaces/iicon';
|
import { IIcon } from './../interfaces/iicon';
|
||||||
import paths from '../../extensions/consts/paths';
|
import paths from '../../extensions/consts/paths';
|
||||||
|
import { ensureDir } from '../../extensions/helpers/fs';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an object implementing the IIcon interface
|
* Returns an object implementing the IIcon interface
|
||||||
|
@ -49,6 +50,8 @@ export default gulp.task('build:icons', cb => {
|
||||||
let partialsData: IGenericObject<any> = {};
|
let partialsData: IGenericObject<any> = {};
|
||||||
let pathTemp: string = './themes/.material-theme-icons.tmp';
|
let pathTemp: string = './themes/.material-theme-icons.tmp';
|
||||||
|
|
||||||
|
ensureDir(path.join(paths.THEMES));
|
||||||
|
|
||||||
icons[icons.length - 1].last = true;
|
icons[icons.length - 1].last = true;
|
||||||
|
|
||||||
partials.forEach(partial => {
|
partials.forEach(partial => {
|
||||||
|
|
|
@ -10,6 +10,7 @@ import { CHARSET } from "../../extensions/consts/files";
|
||||||
import { IDefaults } from "../../extensions/interfaces/idefaults";
|
import { IDefaults } from "../../extensions/interfaces/idefaults";
|
||||||
import { IThemeVariant } from './../interfaces/itheme-variant';
|
import { IThemeVariant } from './../interfaces/itheme-variant';
|
||||||
import paths from '../../extensions/consts/paths';
|
import paths from '../../extensions/consts/paths';
|
||||||
|
import { ensureDir } from '../../extensions/helpers/fs';
|
||||||
|
|
||||||
let commons: IDefaults = require('../../extensions/defaults.json');
|
let commons: IDefaults = require('../../extensions/defaults.json');
|
||||||
|
|
||||||
|
@ -37,6 +38,8 @@ fileNames.forEach(fileName => {
|
||||||
export default gulp.task('build:themes', cb => {
|
export default gulp.task('build:themes', cb => {
|
||||||
gulpUtil.log(gulpUtil.colors.gray(HR));
|
gulpUtil.log(gulpUtil.colors.gray(HR));
|
||||||
|
|
||||||
|
ensureDir(path.join(paths.THEMES));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
themeVariants.forEach(variant => {
|
themeVariants.forEach(variant => {
|
||||||
let filePath = path.join(paths.THEMES, `./${variant.name}.json`);
|
let filePath = path.join(paths.THEMES, `./${variant.name}.json`);
|
||||||
|
|
|
@ -8,6 +8,16 @@ import { IDefaults } from "../interfaces/idefaults";
|
||||||
import { IThemeIcons } from "../interfaces/itheme-icons";
|
import { IThemeIcons } from "../interfaces/itheme-icons";
|
||||||
import { PATHS } from "../consts/paths";
|
import { PATHS } from "../consts/paths";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @export
|
||||||
|
* @param {string} dirname
|
||||||
|
*/
|
||||||
|
export function ensureDir(dirname: string): void {
|
||||||
|
if (!fs.existsSync(dirname)) {
|
||||||
|
fs.mkdirSync(dirname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets default value
|
* Gets default value
|
||||||
* @export
|
* @export
|
||||||
|
|
Loading…
Reference in a new issue