mirror of
https://github.com/yusufipk/RepoHub.git
synced 2026-09-11 10:36:07 +00:00
feat: add multiple package sync sources and API integration
- Added undici dependency and implemented three package fetcher variants (simple text parsing, v2 with better error handling, and official repository sync) - Integrated real API calls in PlatformSelector and PackageBrowser components with fallback to mock data - Extended sync API route to support multiple data sources (debian-simple, ubuntu-simple, debian-official-v2, etc.) with platform initialization
This commit is contained in:
@@ -13,8 +13,9 @@ export function generateScript(packages: SelectedPackage[], platform: Platform):
|
||||
|
||||
function createScriptContent(packages: SelectedPackage[], platform: Platform): string {
|
||||
switch (platform.id) {
|
||||
case 'debian':
|
||||
case 'ubuntu':
|
||||
return generateUbuntuScript(packages)
|
||||
return generateDebianBasedScript(packages, platform.name)
|
||||
case 'fedora':
|
||||
return generateFedoraScript(packages)
|
||||
case 'arch':
|
||||
@@ -28,18 +29,18 @@ function createScriptContent(packages: SelectedPackage[], platform: Platform): s
|
||||
}
|
||||
}
|
||||
|
||||
function generateUbuntuScript(packages: SelectedPackage[]): string {
|
||||
function generateDebianBasedScript(packages: SelectedPackage[], platformName: string): string {
|
||||
const packageNames = packages.map(p => p.name).join(' ')
|
||||
|
||||
return `#!/bin/bash
|
||||
|
||||
# RepoHub Installation Script for Ubuntu/Debian
|
||||
# RepoHub Installation Script for ${platformName}
|
||||
# Generated on ${new Date().toISOString()}
|
||||
# This script is idempotent and safe to run multiple times
|
||||
|
||||
set -e
|
||||
|
||||
echo "Starting package installation for Ubuntu/Debian..."
|
||||
echo "Starting package installation for ${platformName}..."
|
||||
|
||||
# Update package lists
|
||||
echo "Updating package lists..."
|
||||
|
||||
Reference in New Issue
Block a user