|
@@ -54,24 +54,6 @@ class ScribeController extends Controller
|
|
|
|
|
|
File::put($envPath, $envContent);
|
|
|
|
|
|
- // 4. 清除所有缓存并生成文档
|
|
|
- $commands = [
|
|
|
- 'cd ' . base_path(),
|
|
|
- 'php artisan config:clear',
|
|
|
- 'php artisan cache:clear',
|
|
|
- 'php artisan route:clear',
|
|
|
- 'rm -rf .scribe/endpoints.cache',
|
|
|
- 'rm -rf public/docs', // 删除旧的静态文件
|
|
|
- 'php artisan scribe:generate'
|
|
|
- ];
|
|
|
-
|
|
|
- $output = [];
|
|
|
- $returnVar = 0;
|
|
|
- exec(implode(' && ', $commands) . ' 2>&1', $output, $returnVar);
|
|
|
-
|
|
|
- if ($returnVar !== 0) {
|
|
|
- throw new \RuntimeException('Failed to generate documentation: ' . implode("\n", $output));
|
|
|
- }
|
|
|
|
|
|
// 5. 直接更新 auth.md 文件
|
|
|
$authPath = base_path('.scribe/auth.md');
|