Files
miasma-installer/main.go
tumillanino a7bd4d9457
Some checks failed
Build / build (push) Failing after 4m53s
added cosmic packages to installer. Still no auto reboot
2025-10-31 23:12:11 +11:00

43 lines
967 B
Go

package main
import (
"fmt"
"miasma-installer/tui"
"os"
tea "github.com/charmbracelet/bubbletea"
)
func main() {
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)
}
if root, ok := finalModel.(tui.RootModel); ok {
if root.State == tui.StateFinished {
fmt.Println("\n✓ Miasma 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)
}
}
}