(config: Config)
| 84 | } |
| 85 | |
| 86 | export async function checkAppConfig(config: Config): Promise<string | null> { |
| 87 | if (!config.app.appId) { |
| 88 | return ( |
| 89 | `Missing ${c.input('appId')} for new platform.\n` + |
| 90 | `Please add it in ${config.app.extConfigName} or run ${c.input('npx cap init')}.` |
| 91 | ); |
| 92 | } |
| 93 | if (!config.app.appName) { |
| 94 | return ( |
| 95 | `Missing ${c.input('appName')} for new platform.\n` + |
| 96 | `Please add it in ${config.app.extConfigName} or run ${c.input('npx cap init')}.` |
| 97 | ); |
| 98 | } |
| 99 | |
| 100 | const appIdError = await checkAppId(config, config.app.appId); |
| 101 | if (appIdError) { |
| 102 | return appIdError; |
| 103 | } |
| 104 | |
| 105 | const appNameError = await checkAppName(config, config.app.appName); |
| 106 | if (appNameError) { |
| 107 | return appNameError; |
| 108 | } |
| 109 | |
| 110 | return null; |
| 111 | } |
| 112 | |
| 113 | export async function checkAppDir(config: Config, dir: string): Promise<string | null> { |
| 114 | if (!/^\S*$/.test(dir)) { |
no test coverage detected