31 lines
885 B
Go
31 lines
885 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
"os"
|
|
"path/filepath"
|
|
"time"
|
|
|
|
"git.parchlinux.com/applications/parchie-buggy/collector"
|
|
)
|
|
|
|
func Execute() {
|
|
fmt.Println("[+] Parch Bug Reporter Starting...")
|
|
timestamp := time.Now().Format("2006-01-02_15-04-05")
|
|
outputDir := filepath.Join("output", timestamp)
|
|
if err := os.MkdirAll(outputDir, 0755); err != nil {
|
|
log.Fatalf("Failed to create output directory: %v", err)
|
|
}
|
|
fmt.Println("[+] Collecting system info...")
|
|
if err := collector.Collect(outputDir, true, true); err != nil {
|
|
log.Fatalf("Error collecting system info: %v", err)
|
|
}
|
|
archiveName := fmt.Sprintf("parch-bugreport-%s.zip", timestamp)
|
|
fmt.Println("[+] Compressing report to", archiveName)
|
|
if err := collector.ZipFolder(outputDir, archiveName); err != nil {
|
|
log.Fatalf("Failed to compress archive: %v", err)
|
|
}
|
|
fmt.Println("[✓] Report complete:", archiveName)
|
|
}
|