Skip to content

Commit 5468eba

Browse files
committed
feat: add imported date to moved files
1 parent a3ecbf8 commit 5468eba

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/scripts/import.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
import { statSync } from "fs";
2626
import { CommandArgs } from "../cli.js";
2727
import { print } from "../utils/index.js";
28+
import { getFormattedDate } from "../utils/date.js";
2829

2930
export const run = async (
3031
config: Configuration,
@@ -187,7 +188,11 @@ export const run = async (
187188

188189
const destination = config.moveFilesAfterImport[importAccountName];
189190
if (destination) {
190-
renameSync(currentFile, path.join(destination, csvFile));
191+
const newCsvFile = csvFile.replace(
192+
".csv",
193+
`-IMPORTED-${getFormattedDate()}.csv`
194+
);
195+
renameSync(currentFile, path.join(destination, newCsvFile));
191196
}
192197
}
193198
};

0 commit comments

Comments
 (0)