v1.0
This commit is contained in:
30
index.js
Normal file
30
index.js
Normal file
@@ -0,0 +1,30 @@
|
||||
const { processAndOrganizeNotes } = require('./src/noteOrganizer');
|
||||
const { writeOrganizedNotes } = require('./src/outputWriter');
|
||||
|
||||
async function main() {
|
||||
try {
|
||||
const args = process.argv.slice(2);
|
||||
if (args.length < 1 || args.length > 2) {
|
||||
console.log('Usage: node index.js <directory_path> [file_pattern]');
|
||||
return;
|
||||
}
|
||||
|
||||
const [dirPath, pattern] = args;
|
||||
|
||||
console.log(`Starting to process notes in: ${dirPath}`);
|
||||
if (pattern) {
|
||||
console.log(`Filtering by pattern: ${pattern}`);
|
||||
}
|
||||
|
||||
const organizedNotes = await processAndOrganizeNotes(dirPath, pattern);
|
||||
|
||||
if (organizedNotes) {
|
||||
writeOrganizedNotes(__dirname, organizedNotes);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('An unexpected error occurred:', error);
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
|
||||
Reference in New Issue
Block a user