(schemaFile: string)
| 165 | } |
| 166 | |
| 167 | export async function requireDataSourceUrl(schemaFile: string) { |
| 168 | const zmodel = await loadSchemaDocument(schemaFile); |
| 169 | const dataSource = zmodel.declarations.find(isDataSource); |
| 170 | if (!dataSource?.fields.some((f) => f.name === 'url')) { |
| 171 | throw new CliError('The schema\'s "datasource" must have a "url" field to use this command.'); |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | export function getOutputPath(options: { output?: string }, schemaFile: string) { |
| 176 | if (options.output) { |
no test coverage detected