()
| 27 | |
| 28 | // Only process files passed as arguments (from lint-staged) |
| 29 | async function main() { |
| 30 | const args = process.argv.slice(2); |
| 31 | const stagedFlag = args.includes("--staged"); |
| 32 | const filePaths = args.filter((arg) => !arg.startsWith("--")); |
| 33 | |
| 34 | if (stagedFlag && filePaths.length > 0) { |
| 35 | for (const file of filePaths) { |
| 36 | await updateDatabaseVersion(file); |
| 37 | } |
| 38 | } else { |
| 39 | console.log("No staged files to process or --staged flag not set."); |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | main(); |
no test coverage detected