Skip to content

Commit

Permalink
feat: add imported date to moved files
Browse files Browse the repository at this point in the history
  • Loading branch information
joshcanhelp committed Jan 5, 2024
1 parent a3ecbf8 commit 5468eba
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/scripts/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
import { statSync } from "fs";
import { CommandArgs } from "../cli.js";
import { print } from "../utils/index.js";
import { getFormattedDate } from "../utils/date.js";

export const run = async (
config: Configuration,
Expand Down Expand Up @@ -187,7 +188,11 @@ export const run = async (

const destination = config.moveFilesAfterImport[importAccountName];
if (destination) {
renameSync(currentFile, path.join(destination, csvFile));
const newCsvFile = csvFile.replace(
".csv",
`-IMPORTED-${getFormattedDate()}.csv`
);
renameSync(currentFile, path.join(destination, newCsvFile));
}
}
};

0 comments on commit 5468eba

Please sign in to comment.