added cosmic packages to installer. Still no auto reboot
Some checks failed
Build / build (push) Failing after 4m53s
Some checks failed
Build / build (push) Failing after 4m53s
This commit is contained in:
29
main.go
29
main.go
@@ -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("\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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user