Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
logger.info(`Removing [${paths.map(p => path.relative(process.cwd(), p)).join(', ')}]`);
const cleanTasks = paths
.map(
cleanPath =>
function(cb: (error: Error | null) => void) {
fse.remove(cleanPath, cb);
}
)
.concat((cb: (error: Error | null) => void) => {
clearCache();
cb(null);
});
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
parallelLimit(cleanTasks, limit!, done);
};
}
const css = result.css.toString();
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
postcss([autoprefixerFn, ...postcssPlugins!])
.process(css, { from: fileName })
.then((result: { css: string }) => {
fs.writeFileSync(fileName + '.ts', createSourceModule(fileName, result.css));
cb();
});
}
}
);
}
);
parallelLimit(tasks, 5, done);
} else {
done();
}
};
}
console.log('Req end in ' + (Date.now() - start) + 'ms ' + metadataPath)
zipfile.addBuffer(Buffer.from(arrBuf), metadataPath, {
...options,
store: true
})
cb()
})
.catch(err => {
missing.push(metadataPath)
console.log('Error downloading file ' + metadataPath, err)
cb()
})
})
const start = Date.now()
console.log('Starting download')
run(tasks, concurrency, (...args) => {
console.log('Downloaded images in ' + (Date.now() - start) + 'ms')
if (missing.length) {
zipfile.addBuffer(
Buffer.from(missing.join('\r\n') + '\r\n'),
'missing.txt'
)
}
zipfile.end()
})
return zipfile.outputStream
}
const cp = spawn(npmCmd, npmArgs, { stdio: 'pipe' });
let json = '';
cp.stdout.on('data', (data: any) => {
json = json + data.toString();
});
cp.on('exit', code => {
const info = JSON.parse(json);
versionInfo[name] = { tags: info['dist-tags'], versions: info['versions'] };
cb();
});
}
);
parallelLimit(checkVersionTasks, 5, () => {
resolve(versionInfo);
});
});
}
const readStream = fse.createReadStream(matchedPath);
const destPath = path.join(dest!, relativePath);
if (!fse.existsSync(path.dirname(destPath))) {
fse.mkdirpSync(path.dirname(destPath));
}
readStream.pipe(fse.createWriteStream(destPath));
readStream.on('error', err => cb(err));
readStream.on('end', cb);
});
});
}
paths.forEach(copyPath => helper(copyPath));
parallelLimit(copyTasks, limit!, done);
};
}