serverless/lib/utils/fs/copyDirContentsSync.js
Christophe Bougère 49bfee948b sym links:
- adding a noLinks option
- unit test for sym links
2018-01-04 13:03:06 +01:00

17 lines
440 B
JavaScript

'use strict';
const path = require('path');
const fse = require('./fse');
const walkDirSync = require('./walkDirSync');
function fileExists(srcDir, destDir, options) {
const fullFilesPaths = walkDirSync(srcDir, options);
fullFilesPaths.forEach(fullFilePath => {
const relativeFilePath = fullFilePath.replace(srcDir, '');
fse.copySync(fullFilePath, path.join(destDir, relativeFilePath));
});
}
module.exports = fileExists;