import { existsSync , promises } from 'fs' ; import { basename , join , resolve } from 'path' ; import { createLogger } from '@sap-cloud-sdk/util' ; const { copyFile : fsCopyFile } = promises ; const logger = createLogger ( 'generator-common' ) ; param src param dest param overwrite internal export async function copyFile ( src , dest , overwrite = false ) { if ( ! overwrite && existsSync ( dest ) ) { return ; } return fsCopyFile ( src , dest ) ; } param files param dest param overwrite internal export async function copyFiles ( files , dest , overwrite ) { logger . verbose ( `Copying additional files ${ files } into ${ dest }.` ) ; return Promise . all ( files . map ( filePath => copyFile ( resolve ( filePath ) , join ( dest , basename ( filePath ) ) , overwrite ) ) ) ; }