2021-03-27 22:45:57 +03:00

22 lines
609 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// php create templates
import gulp from 'gulp';
import header from 'gulp-header';
const checkNewTemplates = (event) => {
const fileName = event.slice(10, -4)
const templateName = fileName[0].toUpperCase() + fileName.slice(1)
const templateString = `<?php
/**
* Template Name: ${templateName}
*/
?>`
gulp.src(event)
.pipe(header(templateString))
.pipe(gulp.dest('./'))
//TODO создавать файл .sass фаайл в src/pages с именем созданного файла в templates
}
export const phpDevelop = () => gulp.watch('templates/*.php').on('add', checkNewTemplates)