added cosmic packages to installer. Still no auto reboot
Some checks failed
Build / build (push) Failing after 4m53s

This commit is contained in:
tumillanino
2025-10-31 23:12:11 +11:00
parent ee79d720ec
commit a7bd4d9457
3 changed files with 169 additions and 38 deletions

29
main.go
View File

@@ -9,17 +9,34 @@ import (
)
func main() {
p := tea.NewProgram(tui.NewModel(), tea.WithAltScreen())
if _, err := p.Run(); err != nil {
fmt.Printf("An error has occured during installation: %v\n", err)
if os.Geteuid() != 0 {
fmt.Println("Error: This installer must be run as root")
fmt.Println("Please run: sudo miasma-installer")
os.Exit(1)
}
if _, err := os.Stat("/sys/firmware/efi"); os.IsNotExist(err) {
fmt.Println("Error: UEFI boot mode not detected")
fmt.Println("Miasma OS requires UEFI boot mode")
os.Exit(1)
}
p := tea.NewProgram(tui.NewModel(), tea.WithAltScreen())
finalModel, err := p.Run()
if err != nil {
fmt.Printf("\nAn error occurred during installation: %v\n", err)
os.Exit(1)
}
finalModel, _ := p.Run()
if root, ok := finalModel.(tui.RootModel); ok {
if root.State == tui.StateFinished {
fmt.Println("\nMiasma OS Installation Complete! Please reboot.")
fmt.Println("\nMiasma OS Installation Complete!")
fmt.Println("\nThe system will reboot in 5 seconds...")
fmt.Println("Press Ctrl+C to cancel reboot")
fmt.Print("\nUnmounting filesystems...")
os.Exit(0)
}
}
}