const { src, dest, series } = require('gulp');
const glob = require("glob");
const fs = require('fs');
async function test1() {
glob(__dirname + '/build/**/*.css', {}, (error, files) => {
if (error) throw error;
function readFiles() {
let subarray = [];
for (let name of files) {
subarray = name.split();
let globFile = subarray + '';
let dateFiles = '';
fs.readFile(globFile, "utf8",
function(error, data) {
if (error) throw error;
// log('Асинхронное чтение файла');
// log(data); // выводим считанные данные
return dateFiles = data;
})
}
}
readFiles();
log(readFiles());
})
}
exports.test1= series(test1);
const { src, dest, series } = require('gulp');
const glob = require("glob");
const fs = require('fs');
async function test1() {
let res = null; // <===
glob(__dirname + '/build/**/*.css', {}, (error, files) => {
if (error) throw error;
function readFiles() {
let subarray = [];
for (let name of files) {
subarray = name.split();
let globFile = subarray + '';
let dateFiles = '';
fs.readFile(globFile, "utf8",
function(error, data) {
if (error) throw error;
res = data; // <===
})
}
}
readFiles();
log(readFiles());
})
return res; <===
}
exports.test1= series(test1);