There was an error while loading. Please reload this page.
1 parent ff435f3 commit f7160b5Copy full SHA for f7160b5
1 file changed
src/app.js
@@ -1 +1,27 @@
1
+/* eslint-disable no-console */
2
+
3
'use strict';
4
5
+import fsp from 'node:fs/promises';
6
7
+async function main() {
8
+ const argv = process.argv.slice(2);
9
10
+ if (argv.length < 2 || argv[0] === argv[1]) {
11
+ return;
12
+ }
13
14
+ const [filePath, filePathCopy] = argv;
15
16
+ try {
17
+ const fileData = await fsp.readFile(filePath, 'utf8');
18
19
+ await fsp.writeFile(filePathCopy, fileData).catch((error) => {
20
+ console.log(error);
21
+ });
22
+ } catch (error) {
23
24
25
+}
26
27
+main();
0 commit comments