diff --git a/src/app.js b/src/app.js index ad9a93a..cd01b55 100644 --- a/src/app.js +++ b/src/app.js @@ -1 +1,19 @@ 'use strict'; + +const fs = require('fs'); + +const copyFile = (src, dest) => { + if (src === dest || !src || !dest) { + throw new Error('Unable to copy file'); + } + + const stats = fs.statSync(src); + + if (!stats.isFile()) { + return; + } + + fs.copyFileSync(src, dest); +}; + +copyFile(...process.argv.slice(2));