feat: Add repository status and update functionality

- Add ORIGINAL_REPO_URL environment variable for repository updates
- Create RepoStatusButton component with status display and update functionality
- Enhance GitManager with fullUpdate() method (git pull + npm install + build)
- Add fullUpdateRepo API endpoint for complete repository updates
- Display repository status with visual indicators (up-to-date, updates available, etc.)
- Show real-time progress during update process
- Add manual refresh capability for repository status
- Integrate repository status component into main page
This commit is contained in:
Michel Roegl-Brunner
2025-09-15 15:31:51 +02:00
parent 067a7d6e79
commit cb724f245b
14 changed files with 1334 additions and 92 deletions

View File

@@ -73,8 +73,17 @@ export class LocalScriptsService {
async getScriptBySlug(slug: string): Promise<Script | null> {
try {
const scripts = await this.getAllScripts();
return scripts.find(script => script.slug === slug) ?? null;
// Try to read the specific script file directly instead of loading all scripts
const filename = `${slug}.json`;
const filePath = join(this.scriptsDirectory, filename);
try {
const content = await readFile(filePath, 'utf-8');
return JSON.parse(content) as Script;
} catch (fileError) {
// If file doesn't exist, return null instead of throwing
return null;
}
} catch (error) {
console.error('Error fetching script by slug:', error);
throw new Error(`Failed to fetch script: ${slug}`);