()
| 41 | }; |
| 42 | |
| 43 | export const cli = () => { |
| 44 | const cliArguments = yargs(hideBin(process.argv)) |
| 45 | .option('config', { |
| 46 | description: 'Path to "config.json" file to validate', |
| 47 | alias: 'c', |
| 48 | type: 'string', |
| 49 | demandOption: true, |
| 50 | }) |
| 51 | .option('secrets', { |
| 52 | description: 'Path to "secrets.env" file to interpolate in the config', |
| 53 | alias: 's', |
| 54 | type: 'string', |
| 55 | // Making the secrets file required. If the users do not use a secrets file they can pass any empty file. However, |
| 56 | // not passing a secrets file is not recommended and usually is a mistake. |
| 57 | demandOption: true, |
| 58 | }) |
| 59 | .strict() |
| 60 | .help() |
| 61 | .wrap(120) |
| 62 | .example(examples.map((e) => [e])) |
| 63 | .parseSync(); |
| 64 | |
| 65 | const { config, secrets } = cliArguments; |
| 66 | validateConfiguration(config, secrets); |
| 67 | }; |
no test coverage detected