validateLocal method
初期化済みのローカル設定と依存を、生成前に検証します。
Implementation
void validateLocal(ExecContext context) {
for (final path in [
"cloudflare/wrangler.jsonc",
"cloudflare/.gitignore",
if (isCloudflareRegionWorkerEnabled(context.yaml))
"cloudflare/$cloudflareRegionWranglerConfig",
]) {
if (!File(path).existsSync()) {
throw StateError("--local に必要な初期設定がありません: $path。初期化の承認と実施が必要です。");
}
}
if (context.yaml
.getAsMap("cloudflare")
.getAsMap("workers")
.get("enable", false)) {
validateLocalCloudflarePackages(const [
"hono",
"@mathrunet/masamune",
"@mathrunet/masamune_cloudflare"
]);
validateLocalFlutterDependencies(const ["masamune_functions_cloudflare"]);
}
}