(email)
| 45 | } |
| 46 | |
| 47 | export function validateEmail(email) { |
| 48 | if (!email || typeof email !== 'string' || !email.includes('@')) { |
| 49 | log('ERROR', `Invalid or missing -email argument: ${JSON.stringify(email)}`) |
| 50 | log('ERROR', 'Usage: node script.js -email you@example.com') |
| 51 | process.exit(1) |
| 52 | } |
| 53 | |
| 54 | return email |
| 55 | } |
| 56 | |
| 57 | export function loadJsonFile(possiblePaths, required = true) { |
| 58 | for (const filePath of possiblePaths) { |