8000 fix(cli): empty file stats lookup (#99) · Leo4815162342/dukascopy-node@5a9f8af · GitHub
[go: up one dir, main page]

Skip to content

Commit 5a9f8af

Browse files
fix(cli): empty file stats lookup (#99)
1 parent 8d83118 commit 5a9f8af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cli/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { resolve, join } from 'path';
44
import { progressBar } from './progress';
5-
import { ensureDir, stat } from 'fs-extra';
5+
import { ensureDir, ensureFile, stat } from 'fs-extra';
66
import { isValid, validationErrors, input } from './config';
77
import { normaliseDates } from '../dates-normaliser';
88
import { generateUrls } from '../url-generator';
@@ -143,6 +143,7 @@ if (isDebugActive) {
143143
}
144144

145145
const relativeFilePath = join(dir, fileName);
146+
await ensureFile(filePath);
146147
const { size } = await stat(filePath);
147148
printSuccess(`√ File saved: ${chalk.bold(relativeFilePath)} (${formatBytes(size)})`);
148149
} else {

0 commit comments

Comments
 (0)
0